I'm getting ClassNotPersistenceCapableException when trying to persist the following JDO class.
package com.xxx.cms.model;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;
@PersistenceCapable
public class Transaction {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private String type;
@Persistent
private Text details;
@Persistent
private Company client;
@Persistent
private Carrier carrier;
@Persistent
private Company sender;
@Persistent
private Company recipient;
@Persistent
private Customs customs;
public Transaction(String type, Text details, Company client, Carrier carrier, Company sender, Company recipient, Customs customs){
this.setType(type);
this.setDetails(details);
this.setClient(client);
this.setCarrier(carrier);
this.setSender(sender);
this.setRecipient(recipient);
this.setCustoms(customs);
}
....
}
Then when I run the following:
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
pm.makePersistent(carrier);
pm.makePersistent(sender);
pm.makePersistent(recipient);
pm.makePersistent(client);
pm.makePersistent(cargo);
pm.makePersistent(finance);
pm.makePersistent(customs);
Transaction transaction = new Transaction(transactionType, transactionDetails, client, carrier, sender, recipient, customs);
pm.makePersistent(transaction);
} finally {
pm.close();
}
I get the following exception in the app logs:
org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException: The class "The class "com.xxx.cms.model.Transaction" is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-Data/annotations for the class are not found." is not persistable. This means that it either hasnt been enhanced, or that the enhanced version of the file is not in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-Data for the class is not found.
Any ideas why GAE is throwing this exception? The data from the other classes is persisted successfully as I can see it from the data viewer.