I use eclipse. I create new project for create Junit tests of my GAE
application, add my gae application in JavaBuildPath/Project. Than i
copy all jars from sdk to lib in my project and add all to build path.
in constructor i create helper:
helper = new LocalServiceTestHelper(
new LocalDatastoreServiceTestConfig()
);
in setUp method i do
helper.setUp();
PersistenceManager pm = PMF.get().getPersistenceManager(); // - this
line throw exception (stacktrace below)
I tried create jdoconfig.xml - but have compile error - duplicate
description.
java.lang.ExceptionInInitializerError
at
ru.abc_software.horoscope.test.HoroscopePageTest.Empty(HoroscopePageTest.java:
35)
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 org.junit.runners.model.FrameworkMethod
$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:
15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:
41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:
20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:
28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
73)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:
28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
197)
Caused by: javax.jdo.JDOFatalInternalException: Unexpected exception
caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException at
javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:
1186)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:
803)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:
1086)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:
914)
at ru.abc_software.horoscope.test.PMF.<clinit>(PMF.java:8)
... 25 more
Caused by: java.lang.reflect.InvocationTargetException
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 javax.jdo.JDOHelper$16.run(JDOHelper.java:1956)
at java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1951)
at
javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:
1159)
... 29 more
Caused by: org.datanucleus.exceptions.NucleusException: Plugin
(Bundle) "org.datanucleus.jpa" is already registered. Ensure you dont
have multiple JAR versions of the same plugin in the classpath. The
URL "file:/C:/Users/Timofey.NovaBigBook-PC/Documents/Eclipse/
HoroscopeTest/lib/datanucleus-jpa-1.1.5.jar" is already registered,
and you are trying to register an identical plugin located at URL
"file:/C:/Users/Timofey.NovaBigBook-PC/Documents/Eclipse/Horoscope/war/
WEB-INF/lib/datanucleus-jpa-1.1.5.jar."
at
org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:
434)
at
org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonManagedPluginRegistry.java:
340)
at
org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(NonManagedPluginRegistry.java:
222)
at
org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(NonManagedPluginRegistry.java:
153)
at
org.datanucleus.plugin.PluginManager.registerExtensionPoints(PluginManager.java:
82)
at org.datanucleus.OMFContext.<init>(OMFContext.java:160)
at org.datanucleus.OMFContext.<init>(OMFContext.java:141)
at
org.datanucleus.ObjectManagerFactoryImpl.initialiseOMFContext(ObjectManagerFactoryImpl.java:
144)
at
org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:
316)
at
org.datanucleus.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:
260)
at
org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory.<init>(DatastoreJDOPersistenceManagerFactory.java:
71)
at
org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory.getPersistenceManagerFactory(DatastoreJDOPersistenceManagerFactory.java:
126)
... 37 more
--
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.