I originally posted this on General discussion, not realizing there is
a Java specific group, so I am sorry for the redundancy:
I have gotten the basic setup recommended in the docs. I am able to
query the database successfully but as soon as I attempt to persists a
JDO object I get a can't find annotations error. The code is simply:
public class UserTestCase extends LocalDatastoreTestCase {
public void testDatesBeingSetOnCreate() {
User user = new User("[email protected]", "mypassword");
//DatastoreServiceFactory.getDatastoreService().put(user);
PersistenceManager manager = newPersistenceManager();
manager.makePersistent(user);
manager.close();
Query query = new Query(User.class.getSimpleName());
assertEquals(1, DatastoreServiceFactory.getDatastoreService
().prepare(query).countEntities());
}
}
The error occurs at the makePersistent call. If I comment it out the
test runs fine except of course there is no user on the assert line.
The error is:
org.datanucleus.jdo.exceptions.NoPersistenceInformationException: The
class "The class "com.sootra.shared.User" is required to be
persistable yet no Meta-Data/Annotations can be found for this class.
Please check that the Meta-Data/annotations is defined in a valid file
location." is required to be persistable yet no Meta-Data can be found
for this class. Please check that the Meta-Data is defined in a valid
file location for JDO.
I am able to run the create user fine when running the app locally, as
well as uploading it to app engine. So the code is fine, but I am
unable to get JUnit test to recognize where the MetaData is being
created by the enhancer.
Has anyone successfully gotten this to run in Eclipse. I am guessing
that I am missing some classpath setting or meta information, but can
not find any references anywhere on the net yet.
--
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 [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-java?hl=en.