On Sun, Nov 3, 2013 at 12:29 AM, Jean-Louis MONTEIRO <jeano...@gmail.com>wrote:

> Hi Matthias,
>
> The openejb-core-hibernate is just a helper pom.
> It aims at providing a easy way from an end user point of view to use
> Hibernate as the JPA provider instead of OpenJPA by default.
>
> The pom just excludes OpenJPA and includes Hibernate.
> If you wanna use OpenJPA, you have to use openejb-core instead of
> openejb-core-hibernate.
>


yeah - the intention was using Hibernate :-)


The point is on the tomee-1.5.2 branch the same "-hibernate" module is able
to actually use the default OpenJPA impl. class (which is fine for me),
when there is no explicit <provider> mentioned. I am not getting the
ClassNotFoundException
there

However, I am getting a different error there:
user lacks privilege or object not found: OPENJPA_SEQUENCE_TABLE


But using
  <property name="openjpa.jdbc.SynchronizeMappings"
                  value="buildSchema(ForeignKeys=true)" />
helps.


I think the main reason why I initially ran into this first, is the fact
that I really want for unit tests only my src/test/.....persistence.xml to
be used:

http://openejb.979440.n4.nabble.com/test-resources-persistence-xml-td4665887.html


-Matthias






>
> Hope it helps
> JLouis
>
>
>
> 2013/11/3 Matthias Wessendorf <mat...@apache.org>
>
> > 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
> >
>
>
>
> --
> Jean-Louis
>



-- 
Matthias Wessendorf

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

Reply via email to