Hello!

On trunk, when removing the <provider> element of the persistence.xml ([1])
the openejb-core-hibernate module assumes that the OpenJPA impl. should be
used.


However, the test here fails, since it can not find the OpenJPA
implementation; See stacktrace below.


-Matthias

[1]
https://github.com/apache/tomee/blob/trunk/examples/jpa-hibernate/src/main/resources/META-INF/persistence.xml#L24



org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
org.apache.openejb.OpenEJBException: Creating application failed:
/Users/matzew/TEMP/TomEE/examples/jpa-hibernate:
org.apache.openejb.OpenEJBRuntimeException:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:419)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
at org.superbiz.injection.h3jpa.MoviesTest.test(MoviesTest.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: org.apache.openejb.OpenEJBException: Creating application
failed: /Users/matzew/TEMP/TomEE/examples/jpa-hibernate:
org.apache.openejb.OpenEJBRuntimeException:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:897)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:415)
... 27 more
Caused by: org.apache.openejb.OpenEJBException:
org.apache.openejb.OpenEJBRuntimeException:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:758)
... 29 more
Caused by: org.apache.openejb.OpenEJBRuntimeException:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:117)
at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:101)
at
org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:150)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:752)
... 29 more
Caused by: java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:47)
at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:115)
... 32 more


-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Reply via email to