Google App Engine ClassNotPersistenceCapableException

Posted by Frank on Stack Overflow See other posts from Stack Overflow or by Frank
Published on 2010-04-23T19:49:47Z Indexed on 2010/04/23 19:53 UTC
Read the original article Hit count: 415

I have the following class :

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.*;

@PersistenceCapable(identityType=IdentityType.APPLICATION)
public class PayPal_Message
{
  @PrimaryKey
  @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
  private Long id;
  @Persistent
  private Text content;
  @Persistent
  private String time;

  public PayPal_Message(Text content,String time)
  {
    this.content=content;
    this.time=time;
  }

  public Long getId() { return id; }
  public Text getContent() { return content; }
  public String getTime() { return time; }
  public void setContent(Text content) { this.content=content; }
  public void setTime(String time) { this.time=time; }
}

It used to be in a package, and works fine, now I put all classes in the default package, which caused me this error :

org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException: The class "The class "PayPal_Message" 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. NestedThrowables: org.datanucleus.exceptions.ClassNotPersistableException: The class "PayPal_Message" 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.

What should I do to fix it ?

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about persistence