[appengine-java] is not persistable
I created a very simple app to persist an object, but got JDOUserException: The class "The class "x.Category" 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. I am using Eclipse + GAE & GWT plugins on Windows. Appreciate any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: is not persistable
1. It is in CLASSPATH as all classes are in the project. 2. I basically copied from the example, so it should not be a problem about annotations. I don't know how to check "hidden by an unenhanced version". Someone said I can find the clues in the debug-level logging, but how can I view them? On Sep 1, 4:14 am, datanucleus wrote: > > The class "The class "x.Category" 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. > > And when you've checked those 3 things ... you can conclude that one > of them is the cause. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: is not persistable
What a shame! I forgot this line on the class: @PersistenceCapable (identityType = IdentityType.APPLICATION) Thx. On Sep 1, 10:20 pm, "Bob L." wrote: > 1. It is in CLASSPATH as all classes are in the project. > 2. I basically copied from the example, so it should not be a problem > about annotations. > > I don't know how to check "hidden by an unenhanced version". Someone > said I can find the clues in the debug-level logging, but how can I > view them? > > On Sep 1, 4:14 am, datanucleus wrote: > > > > > > The class "The class "x.Category" 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. > > > And when you've checked those 3 things ... you can conclude that one > > of them is the cause.- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: is not persistable
Oh mine! It occurred again. JDO looks quite fragile. Is there any wrong with following code? @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Category { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String name; public Category() { } public Category(String name) { this.name = name; } public Long getId() { return id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } serverlet: ... @SuppressWarnings("unchecked") public List getCategories() { String query = "select from " + Category.class.getName(); PersistenceManager pm = PMF.get().getPersistenceManager(); try { return (List) pm.newQuery(query).execute(); } catch (Exception ex) { } return null; } private void initializeCategories() { List categories = this.getCategories(); if (categories == null || categories.isEmpty()) { categories = new ArrayList(); Category category = new Category("Boys"); categories.add(category); category = new Category("Girls"); categories.add(category); PersistenceManager pm = PMF.get().getPersistenceManager(); try { pm.makePersistentAll(categories); } finally { pm.close(); } } } ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---