I alweays got the following error:
When I try to save data using JDO in groovy servlet ,I got the
following error:

org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException:
The class "The class "com.sompackage.Comment" 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.
        at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException
(NucleusJDOHelper.java:241)
My domain class is :
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Comment {
        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Long id;

        @Persistent
        private Date date;

        @Persistent
        private String title;

        @Persistent
        private String content;

        public Comment(Date date, String title, String content) {
                super();
                this.date = date;
                this.title = title;
                this.content = content;
        }

        public String toString() {
                return ReflectionToStringBuilder.toString(this);
        }

        public int hashCode() {
                return HashCodeBuilder.reflectionHashCode(this);
        }

        public boolean equals(Object obj) {
                return EqualsBuilder.reflectionEquals(this, obj);
        }

}

The code in groovy servlet is :
...
def triathlon = new Comment(now, "title", "content")
                def mgr = PersistenceMgr.manufacture()
                try {
                        mgr.makePersistent(triathlon)
                        Query query = pm.newQuery(Comment.class);
                    query.setFilter("title == titleparam");
                    query.setOrdering("title desc");
                    query.declareParameters("String titleparam");
                    List<Comment> results = (List<Employee>) 
query.execute("title");
                if (results.iterator().hasNext()) {
                    for (Comment e : results) {
                        resp.writer.println "Comment from google:"+e
                    }
                } else {
                        esp.writer.println "No data"
                }
                } finally {
                        mgr.close()
                }
                resp.writer.println "Hello Google App Engine Groovy!"
....


Can anybody help me?
Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to