You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by José Luis Cetina <ma...@gmail.com> on 2012/04/27 18:30:45 UTC

TomEE and EclipseLink

(eclipselink 2.3.2.jar, eclipselink-jpa-modelgen_2.3.2.jar,
javax.persistence_2.0.3.jar)

if i try to use eclipselink as provider i get this exception:

Caused by: org.apache.tomee.catalina.TomEERuntimeException:
org.apache.openejb.OpenEJBException: Creating application failed:
C:\Users\maxtorzito\Documents\NetBeansProjects\grupokx\build\web:
java.util.concurrent.ExecutionException: java.lang.ClassCastException:
org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to
javax.persistence.spi.PersistenceProvider: java.lang.ClassCastException:
org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to
javax.persistence.spi.PersistenceProvider



persistence.xml:
.
.
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
.
.




-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: TomEE and EclipseLink

Posted by José Luis Cetina <ma...@gmail.com>.
Criteria querys is the perfect match for dynamic querys and type safe too
El nov 30, 2012 10:25 AM, "Howard W. Smith, Jr." <sm...@gmail.com>
escribió:

> Interesting. No, I'm not using criteria queries. Majority of my queries are
> dynamic SQL queries via persistence query.createQuery(), but just recently,
> I moved some of the more popular queries in the project to @namedQuery.
>
> On Fri, Nov 30, 2012 at 10:38 AM, José Luis Cetina <maxtorzito@gmail.com
> >wrote:
>
> > jpa-modelgen its for generate the metamodel for you entity classes, with
> > this metamodel you can do query's using criteriasquerys, criteriabuilder
> > etc, with this you can create sql query's in typa-safe mode.
> >
> > Have you used, criteria querys/builder in JPA?
> >
> >
> > 2012/11/30 smithh032772 <sm...@gmail.com>
> >
> > > Jose/Romain,
> > >
> > > What was the outcome of this? All I did was add the 'one' eclipselink
> > > (2.3.2) JAR in tomee /lib folder (and 'not' tomee /webapp/lib), and of
> > > course, I specified eclipselink as the provider in persistence.xml.
> > >
> > > After downloading eclipselink from their website, I briefly examined
> the
> > > zip/download file, and a brief examination, I concluded that I only
> > needed
> > > the one JAR file instead of the following:
> > >
> > > (eclipselink 2.3.2.jar, eclipselink-jpa-modelgen_2.3.2.jar,
> > > javax.persistence_2.0.3.jar)
> > >
> > > what is the purpose/need for the jpa-modelgen? is that for weaving?
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/TomEE-and-EclipseLink-tp4593329p4659017.html
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *SCJA. José Luis Cetina*
> > -------------------------------------------------------------------
> >
>

Re: TomEE and EclipseLink

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Interesting. No, I'm not using criteria queries. Majority of my queries are
dynamic SQL queries via persistence query.createQuery(), but just recently,
I moved some of the more popular queries in the project to @namedQuery.

On Fri, Nov 30, 2012 at 10:38 AM, José Luis Cetina <ma...@gmail.com>wrote:

> jpa-modelgen its for generate the metamodel for you entity classes, with
> this metamodel you can do query's using criteriasquerys, criteriabuilder
> etc, with this you can create sql query's in typa-safe mode.
>
> Have you used, criteria querys/builder in JPA?
>
>
> 2012/11/30 smithh032772 <sm...@gmail.com>
>
> > Jose/Romain,
> >
> > What was the outcome of this? All I did was add the 'one' eclipselink
> > (2.3.2) JAR in tomee /lib folder (and 'not' tomee /webapp/lib), and of
> > course, I specified eclipselink as the provider in persistence.xml.
> >
> > After downloading eclipselink from their website, I briefly examined the
> > zip/download file, and a brief examination, I concluded that I only
> needed
> > the one JAR file instead of the following:
> >
> > (eclipselink 2.3.2.jar, eclipselink-jpa-modelgen_2.3.2.jar,
> > javax.persistence_2.0.3.jar)
> >
> > what is the purpose/need for the jpa-modelgen? is that for weaving?
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/TomEE-and-EclipseLink-tp4593329p4659017.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------
>

Re: TomEE and EclipseLink

Posted by José Luis Cetina <ma...@gmail.com>.
jpa-modelgen its for generate the metamodel for you entity classes, with
this metamodel you can do query's using criteriasquerys, criteriabuilder
etc, with this you can create sql query's in typa-safe mode.

Have you used, criteria querys/builder in JPA?


2012/11/30 smithh032772 <sm...@gmail.com>

> Jose/Romain,
>
> What was the outcome of this? All I did was add the 'one' eclipselink
> (2.3.2) JAR in tomee /lib folder (and 'not' tomee /webapp/lib), and of
> course, I specified eclipselink as the provider in persistence.xml.
>
> After downloading eclipselink from their website, I briefly examined the
> zip/download file, and a brief examination, I concluded that I only needed
> the one JAR file instead of the following:
>
> (eclipselink 2.3.2.jar, eclipselink-jpa-modelgen_2.3.2.jar,
> javax.persistence_2.0.3.jar)
>
> what is the purpose/need for the jpa-modelgen? is that for weaving?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-and-EclipseLink-tp4593329p4659017.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: TomEE and EclipseLink

Posted by smithh032772 <sm...@gmail.com>.
Jose/Romain,

What was the outcome of this? All I did was add the 'one' eclipselink
(2.3.2) JAR in tomee /lib folder (and 'not' tomee /webapp/lib), and of
course, I specified eclipselink as the provider in persistence.xml.

After downloading eclipselink from their website, I briefly examined the
zip/download file, and a brief examination, I concluded that I only needed
the one JAR file instead of the following:

(eclipselink 2.3.2.jar, eclipselink-jpa-modelgen_2.3.2.jar, 
javax.persistence_2.0.3.jar) 

what is the purpose/need for the jpa-modelgen? is that for weaving?



--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-and-EclipseLink-tp4593329p4659017.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: TomEE and EclipseLink

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Try putting eclipselink in tomee/openejb webapp lib folder.

Romain
Le 28 avr. 2012 07:20, "maxtorzito" <ma...@gmail.com> a écrit :

> Thanks Romain Manni-Bucau.
>
> But no im trying to use eclipselink 2.3.0 in Tomee+ beta 2 but i get this
> error when i try to run my app:
>
> log:
>
> org.apache.catalina.LifecycleException: Failed to start component
>
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mavenproject1]]
>        at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
>        at
>
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
>        at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
>        at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
>        at
>
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
>        at
>
> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)
>        at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
>        at
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1329)
>        at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>        at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>        at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>        at
>
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
>        at
> org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
>        at
>
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
>        at
> org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
>        at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>        at
>
> org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
>        at
>
> org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
>        at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>        at
>
> org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
>        at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>        at
>
> org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
>        at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>        at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
>        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.catalina.startup.Bootstrap.start(Bootstrap.java:322)
>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
> Caused by: org.apache.tomee.catalina.TomEERuntimeException:
> org.apache.openejb.OpenEJBException: Creating application failed:
>
> C:\Users\maxtorzito\Documents\NetBeansProjects\mavenproject1\target\mavenproject1-1.0-SNAPSHOT:
> java.util.concurrent.ExecutionException: java.lang.LinkageError: loader
> constraint violation in interface itable initialization: when resolving
> method
>
> "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
> the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
> of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for interface
> javax/persistence/spi/PersistenceProvider have different Class objects for
> the type )Ljavax/persistence/spi/ProviderUtil; used in the signature:
> java.lang.LinkageError: loader constraint violation in interface itable
> initialization: when resolving method
>
> "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
> the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
> of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for interface
> javax/persistence/spi/PersistenceProvider have different Class objects for
> the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
>        at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:598)
>        at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:545)
>        at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:117)
>        at
>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>        at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>        at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
>        at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
>        ... 29 more
> Caused by: org.apache.openejb.OpenEJBException: Creating application
> failed:
>
> C:\Users\maxtorzito\Documents\NetBeansProjects\mavenproject1\target\mavenproject1-1.0-SNAPSHOT:
> java.util.concurrent.ExecutionException: java.lang.LinkageError: loader
> constraint violation in interface itable initialization: when resolving
> method
>
> "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
> the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
> of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for interface
> javax/persistence/spi/PersistenceProvider have different Class objects for
> the type )Ljavax/persistence/spi/ProviderUtil; used in the signature:
> java.lang.LinkageError: loader constraint violation in interface itable
> initialization: when resolving method
>
> "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
> the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
> of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for interface
> javax/persistence/spi/PersistenceProvider have different Class objects for
> the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
>        at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:885)
>        at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:497)
>        at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:591)
>        ... 35 more
> Caused by: org.apache.openejb.OpenEJBException:
> java.util.concurrent.ExecutionException: java.lang.LinkageError: loader
> constraint violation in interface itable initialization: when resolving
> method
>
> "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
> the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
> of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for interface
> javax/persistence/spi/PersistenceProvider have different Class objects for
> the type )Ljavax/persistence/spi/ProviderUtil; used in the signature:
> java.lang.LinkageError: loader constraint violation in interface itable
> initialization: when resolving method
>
> "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
> the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
> of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for interface
> javax/persistence/spi/PersistenceProvider have different Class objects for
> the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
>        at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:626)
>        ... 37 more
> Caused by: java.util.concurrent.ExecutionException: java.lang.LinkageError:
> loader constraint violation in interface itable initialization: when
> resolving method
>
> "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
> the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
> of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for interface
> javax/persistence/spi/PersistenceProvider have different Class objects for
> the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
>        at
> java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:262)
>        at java.util.concurrent.FutureTask.get(FutureTask.java:119)
>        at
>
> org.apache.openejb.assembler.classic.PersistenceBuilder.createEmf(PersistenceBuilder.java:169)
>        at
>
> org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:150)
>        at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:620)
>        ... 37 more
> Caused by: java.lang.LinkageError: loader constraint violation in interface
> itable initialization: when resolving method
>
> "org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
> the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
> of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
> the class loader (instance of
> org/apache/catalina/loader/StandardClassLoader) for interface
> javax/persistence/spi/PersistenceProvider have different Class objects for
> the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
>        at java.lang.Class.getDeclaredConstructors0(Native Method)
>        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
>        at java.lang.Class.getConstructor0(Class.java:2714)
>        at java.lang.Class.newInstance0(Class.java:343)
>        at java.lang.Class.newInstance(Class.java:325)
>        at
>
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:45)
>        at
>
> org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:33)
>        at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>        at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>        at java.lang.Thread.run(Thread.java:722)
>
>
>
> pom.xml
> .
> .
> <dependency>
>            <groupId>org.eclipse.persistence</groupId>
>            <artifactId>eclipselink</artifactId>
>            <version>2.3.0</version>
>
>        </dependency>
>        <dependency>
>            <groupId>org.eclipse.persistence</groupId>
>            <artifactId>javax.persistence</artifactId>
>            <version>2.0.3</version>
>            <scope>provided</scope>
>        </dependency>
>        <dependency>
>            <groupId>org.eclipse.persistence</groupId>
>
> <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
>            <version>2.3.0</version>
>
>        </dependency>
>        <dependency>
>            <groupId>javax</groupId>
>            <artifactId>javaee-web-api</artifactId>
>            <version>6.0</version>
>            <scope>provided</scope>
>        </dependency>
> .
> .
> persistence.cml
> .
> .
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> .
> .
>
> Somebody know why? Thanks!!!
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-and-EclipseLink-tp4593329p4594257.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: TomEE and EclipseLink

Posted by maxtorzito <ma...@gmail.com>.
Thanks Romain Manni-Bucau.

But no im trying to use eclipselink 2.3.0 in Tomee+ beta 2 but i get this
error when i try to run my app:

log:

org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mavenproject1]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
	at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
	at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
	at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:558)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1329)
	at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
	at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
	at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
	at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
	at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
	at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
	at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
	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.catalina.startup.Bootstrap.start(Bootstrap.java:322)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
Caused by: org.apache.tomee.catalina.TomEERuntimeException:
org.apache.openejb.OpenEJBException: Creating application failed:
C:\Users\maxtorzito\Documents\NetBeansProjects\mavenproject1\target\mavenproject1-1.0-SNAPSHOT:
java.util.concurrent.ExecutionException: java.lang.LinkageError: loader
constraint violation in interface itable initialization: when resolving
method
"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for interface
javax/persistence/spi/PersistenceProvider have different Class objects for
the type )Ljavax/persistence/spi/ProviderUtil; used in the signature:
java.lang.LinkageError: loader constraint violation in interface itable
initialization: when resolving method
"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for interface
javax/persistence/spi/PersistenceProvider have different Class objects for
the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:598)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:545)
	at
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:117)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
	... 29 more
Caused by: org.apache.openejb.OpenEJBException: Creating application failed:
C:\Users\maxtorzito\Documents\NetBeansProjects\mavenproject1\target\mavenproject1-1.0-SNAPSHOT:
java.util.concurrent.ExecutionException: java.lang.LinkageError: loader
constraint violation in interface itable initialization: when resolving
method
"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for interface
javax/persistence/spi/PersistenceProvider have different Class objects for
the type )Ljavax/persistence/spi/ProviderUtil; used in the signature:
java.lang.LinkageError: loader constraint violation in interface itable
initialization: when resolving method
"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for interface
javax/persistence/spi/PersistenceProvider have different Class objects for
the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:885)
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:497)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:591)
	... 35 more
Caused by: org.apache.openejb.OpenEJBException:
java.util.concurrent.ExecutionException: java.lang.LinkageError: loader
constraint violation in interface itable initialization: when resolving
method
"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for interface
javax/persistence/spi/PersistenceProvider have different Class objects for
the type )Ljavax/persistence/spi/ProviderUtil; used in the signature:
java.lang.LinkageError: loader constraint violation in interface itable
initialization: when resolving method
"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for interface
javax/persistence/spi/PersistenceProvider have different Class objects for
the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:626)
	... 37 more
Caused by: java.util.concurrent.ExecutionException: java.lang.LinkageError:
loader constraint violation in interface itable initialization: when
resolving method
"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for interface
javax/persistence/spi/PersistenceProvider have different Class objects for
the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:262)
	at java.util.concurrent.FutureTask.get(FutureTask.java:119)
	at
org.apache.openejb.assembler.classic.PersistenceBuilder.createEmf(PersistenceBuilder.java:169)
	at
org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:150)
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:620)
	... 37 more
Caused by: java.lang.LinkageError: loader constraint violation in interface
itable initialization: when resolving method
"org.eclipse.persistence.jpa.PersistenceProvider.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;"
the class loader (instance of org/apache/catalina/loader/WebappClassLoader)
of the current class, org/eclipse/persistence/jpa/PersistenceProvider, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for interface
javax/persistence/spi/PersistenceProvider have different Class objects for
the type )Ljavax/persistence/spi/ProviderUtil; used in the signature
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
	at java.lang.Class.getConstructor0(Class.java:2714)
	at java.lang.Class.newInstance0(Class.java:343)
	at java.lang.Class.newInstance(Class.java:325)
	at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:45)
	at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:33)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)



pom.xml
.
.
<dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.3.0</version>
            
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.0.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
           
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
            <version>2.3.0</version>
            
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
.
.
persistence.cml
.
.
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
.
.

Somebody know why? Thanks!!!

--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-and-EclipseLink-tp4593329p4594257.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: TomEE and EclipseLink

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

You probably added the jpa api with eclipselink jars. It is in javaee-api
jar so simply remove the eclipselink jpa api.

Romain
Le 27 avr. 2012 19:51, "José Luis Cetina" <ma...@gmail.com> a écrit :

> (eclipselink 2.3.2.jar, eclipselink-jpa-modelgen_2.3.2.jar,
> javax.persistence_2.0.3.jar)
>
> if i try to use eclipselink as provider i get this exception:
>
> Caused by: org.apache.tomee.catalina.TomEERuntimeException:
> org.apache.openejb.OpenEJBException: Creating application failed:
> C:\Users\maxtorzito\Documents\NetBeansProjects\grupokx\build\web:
> java.util.concurrent.ExecutionException: java.lang.ClassCastException:
> org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to
> javax.persistence.spi.PersistenceProvider: java.lang.ClassCastException:
> org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to
> javax.persistence.spi.PersistenceProvider
>
>
>
> persistence.xml:
> .
> .
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> .
> .
>
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------
>