I've been trying to work out what I'm doing wrong with the following code. It was working last night, and as far as i can remember I haven't changed it.
I have search for hours for a solution but i only seem to find the error in relation to compound keys online. Here's the code: package my.syncdroidserver; import java.util.ArrayList; 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; @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Box { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private final int boxID; @Persistent private final AppUser owner; @Persistent private final String boxName; @Persistent private ArrayList<AppUser> readers; public int getBoxID() { return boxID; } public AppUser getOwner() { return owner; } public ArrayList<AppUser> getReaders() { return readers; } public Box(AppUser owner, String boxName) { this.boxID = BoxUtils.getNextBoxId(); this.owner = owner; this.boxName = boxName; readers = new ArrayList<AppUser>(); readers.add(owner); } public void addReader(AppUser user) { readers.add(user); } public String getBoxName() { return boxName; } // getBoxName; } The error is: DataNucleus Enhancer (version 1.1.4) : Enhancement of classes Nov 5, 2009 9:48:21 AM org.datanucleus.metadata.MetaDataManager initialiseFileMetaDataForUse Errors were encountered when initialising the specified MetaData. See the nested exceptions for details SEVERE: Class my.syncdroidserver.Box has been specified with an object- id class javax.jdo.identity.IntIdentity yet no fields have been identified as primary key fields. Please notate using the "primary- key" tag against the fields that should be considered part of the primary key. org.datanucleus.metadata.InvalidMetaDataException: Class my.syncdroidserver.Box has been specified with an object-id class javax.jdo.identity.IntIdentity yet no fields have been identified as primary key fields. Please notate using the "primary-key" tag against the fields that should be considered part of the primary key. at org.datanucleus.metadata.AbstractClassMetaData.initialiseMemberPositionInformation (AbstractClassMetaData.java:1216) at org.datanucleus.metadata.ClassMetaData.initialise (ClassMetaData.java:664) at org.datanucleus.metadata.MetaDataManager$2.run (MetaDataManager.java:2351) at java.security.AccessController.doPrivileged(Native Method) at org.datanucleus.metadata.MetaDataManager.initialiseAbstractClassMetaData (MetaDataManager.java:2345) at org.datanucleus.metadata.MetaDataManager.initialiseClassMetaData (MetaDataManager.java:2228) at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaData (MetaDataManager.java:2176) at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse (MetaDataManager.java:881) at org.datanucleus.metadata.MetaDataManager.loadClasses (MetaDataManager.java:433) at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput (DataNucleusEnhancer.java:743) at org.datanucleus.enhancer.DataNucleusEnhancer.enhance (DataNucleusEnhancer.java:545) at org.datanucleus.enhancer.DataNucleusEnhancer.main (DataNucleusEnhancer.java:1252) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java: 57) at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java: 60) at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41) Nov 5, 2009 9:48:21 AM org.datanucleus.enhancer.DataNucleusEnhancer main SEVERE: DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused errors Errors were encountered when initialising the specified MetaData. See the nested exceptions for details org.datanucleus.exceptions.NucleusUserException: Errors were encountered when initialising the specified MetaData. See the nested exceptions for details at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse (MetaDataManager.java:892) at org.datanucleus.metadata.MetaDataManager.loadClasses (MetaDataManager.java:433) at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput (DataNucleusEnhancer.java:743) at org.datanucleus.enhancer.DataNucleusEnhancer.enhance (DataNucleusEnhancer.java:545) at org.datanucleus.enhancer.DataNucleusEnhancer.main (DataNucleusEnhancer.java:1252) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java: 57) at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java: 60) at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41) Caused by: org.datanucleus.metadata.InvalidMetaDataException: Class my.syncdroidserver.Box has been specified with an object-id class javax.jdo.identity.IntIdentity yet no fields have been identified as primary key fields. Please notate using the "primary-key" tag against the fields that should be considered part of the primary key. at org.datanucleus.metadata.AbstractClassMetaData.initialiseMemberPositionInformation (AbstractClassMetaData.java:1216) at org.datanucleus.metadata.ClassMetaData.initialise (ClassMetaData.java:664) at org.datanucleus.metadata.MetaDataManager$2.run (MetaDataManager.java:2351) at java.security.AccessController.doPrivileged(Native Method) at org.datanucleus.metadata.MetaDataManager.initialiseAbstractClassMetaData (MetaDataManager.java:2345) at org.datanucleus.metadata.MetaDataManager.initialiseClassMetaData (MetaDataManager.java:2228) at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaData (MetaDataManager.java:2176) at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse (MetaDataManager.java:881) ... 11 more Nested Throwables StackTrace: Class my.syncdroidserver.Box has been specified with an object-id class javax.jdo.identity.IntIdentity yet no fields have been identified as primary key fields. Please notate using the "primary- key" tag against the fields that should be considered part of the primary key. org.datanucleus.metadata.InvalidMetaDataException: Class my.syncdroidserver.Box has been specified with an object-id class javax.jdo.identity.IntIdentity yet no fields have been identified as primary key fields. Please notate using the "primary-key" tag against the fields that should be considered part of the primary key. at org.datanucleus.metadata.AbstractClassMetaData.initialiseMemberPositionInformation (AbstractClassMetaData.java:1216) at org.datanucleus.metadata.ClassMetaData.initialise (ClassMetaData.java:664) at org.datanucleus.metadata.MetaDataManager$2.run (MetaDataManager.java:2351) at java.security.AccessController.doPrivileged(Native Method) at org.datanucleus.metadata.MetaDataManager.initialiseAbstractClassMetaData (MetaDataManager.java:2345) at org.datanucleus.metadata.MetaDataManager.initialiseClassMetaData (MetaDataManager.java:2228) at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaData (MetaDataManager.java:2176) at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse (MetaDataManager.java:881) at org.datanucleus.metadata.MetaDataManager.loadClasses (MetaDataManager.java:433) at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput (DataNucleusEnhancer.java:743) at org.datanucleus.enhancer.DataNucleusEnhancer.enhance (DataNucleusEnhancer.java:545) at org.datanucleus.enhancer.DataNucleusEnhancer.main (DataNucleusEnhancer.java:1252) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused errors at java.lang.reflect.Method.invoke(Method.java:597) at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java: 57) at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java: 60) at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41) DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details Any help would be much appreciated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---