You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by miweiss <ho...@yahoo.com> on 2012/07/06 03:05:59 UTC

EclipseLink + TomEE?

I'm having trouble starting TomEE, and it's because of this error:

<code>
SEVERE: Unable to deploy collapsed ear in war /ReachingRecovery: Exception:
Creating application failed:
C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\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
org.apache.openejb.OpenEJBException: Creating application failed:
C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\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
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:909)
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:506)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:634)
	at
org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:588)
	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:5161)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
	at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	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)
Caused by: org.apache.openejb.OpenEJBException:
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
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:635)
	... 19 more
Caused by: java.util.concurrent.ExecutionException:
java.lang.ClassCastException:
org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to
javax.persistence.spi.PersistenceProvider
	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:629)
	... 19 more
Caused by: java.lang.ClassCastException:
org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to
javax.persistence.spi.PersistenceProvider
	at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:40)
	at
org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:27)
	... 5 more
</code>

I don't see any JPA libraries (okay, except that one - I've already deleted
it) in the TomEE distribution, so I don't understand what's going on.  Can
somebody help?

Thanks!


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

Re: EclipseLink + TomEE?

Posted by zeeman <ha...@fastmail.us>.
You need to do a similar thing I did with Hibernate (but for Eclipselink).
Put all of eclipseLinks jar and its depenencies under tomee/lib. Configure
your persistence.xml the normal way. See this for Hibernate.
http://openejb.apache.org/tomee-and-hibernate.html

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

Re: Netbeans IDE v7.1 example runs on Glassfish but not TomEE

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

We worked on trunk about it.

- Romain
Le 6 juil. 2012 08:49, "Neale Rudd" <ne...@metawerx.net> a écrit :

> Hi Guys,.
>
> This is a report from a customer we are encouraging to use TomEE.
>
>  Hi Neale
>>> thanks for the info - I installed tomEE and found it does not work with
>>> netBeans IDE v7.1 - it wont generate the JSF pages (no EE6 EJB support) I
>>> think its because tomEE uses openEJB and not javax.EJB - however the
>>> glassfish v3 server works a treat. Is there an issue for you with glassfish?
>>>
>>
> Any idea what the cause is or how to fix it?
>
> Best Regards,
> Neale
>
>

Netbeans IDE v7.1 example runs on Glassfish but not TomEE

Posted by Neale Rudd <ne...@metawerx.net>.
Hi Guys,.

This is a report from a customer we are encouraging to use TomEE.

>> Hi Neale
>> thanks for the info - I installed tomEE and found it does not work with 
>> netBeans IDE v7.1 - it wont generate the JSF pages (no EE6 EJB support) I 
>> think its because tomEE uses openEJB and not javax.EJB - however the 
>> glassfish v3 server works a treat. Is there an issue for you with 
>> glassfish?

Any idea what the cause is or how to fix it?

Best Regards,
Neale


Re: EclipseLink + TomEE?

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

Here the way to do with the snapshot
http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/tomee-jersey-eclipselink/pom.xml
 Le 6 juil. 2012 08:30, "Jean-Louis MONTEIRO" <je...@gmail.com> a écrit :

> Guess David's purpose was not to delete EclipseLink jar if you wanna use it
> as you JPA provider.
> The first error reported (ClassCastException) is commonly related to
> duplicate classes in different classloaders. The point is that as a JEE
> Application Server, we already deliver the JPA API (as Tomcat delivers
> Servlet API) and you must not deliver your own API jar in your application.
>
> So definitely try looking if you don't have the JPA API comming with your
> EclipseLink provider (maybe a transitive dependency).
>
> If you still face issues, could you share a simple example to reproduce the
> error?
>
> Hope it helps.
> JLouis
>
>
> 2012/7/6 miweiss <ho...@yahoo.com>
>
> > Hmm.  Are you saying delete the EclipseLink JPA from my app?  I'm using
> JPA
> > to access my database.  And I know it won't work, because I've already
> done
> > that, and it said:
> >
> > SEVERE: Unable to deploy collapsed ear in war /ReachingRecovery:
> Exception:
> > Creating application failed:
> > C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\build\web:
> > java.util.concurrent.ExecutionException:
> java.lang.ClassNotFoundException:
> > org.eclipse.persistence.jpa.PersistenceProvider:
> > java.lang.ClassNotFoundException:
> > org.eclipse.persistence.jpa.PersistenceProvider
> > org.apache.openejb.OpenEJBException: Creating application failed:
> > C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\build\web:
> > java.util.concurrent.ExecutionException:
> java.lang.ClassNotFoundException:
> > org.eclipse.persistence.jpa.PersistenceProvider:
> > java.lang.ClassNotFoundException:
> > org.eclipse.persistence.jpa.PersistenceProvider
> >
> > I'm stumped.
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/EclipseLink-TomEE-tp4656073p4656076.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Re: EclipseLink + TomEE?

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Guess David's purpose was not to delete EclipseLink jar if you wanna use it
as you JPA provider.
The first error reported (ClassCastException) is commonly related to
duplicate classes in different classloaders. The point is that as a JEE
Application Server, we already deliver the JPA API (as Tomcat delivers
Servlet API) and you must not deliver your own API jar in your application.

So definitely try looking if you don't have the JPA API comming with your
EclipseLink provider (maybe a transitive dependency).

If you still face issues, could you share a simple example to reproduce the
error?

Hope it helps.
JLouis


2012/7/6 miweiss <ho...@yahoo.com>

> Hmm.  Are you saying delete the EclipseLink JPA from my app?  I'm using JPA
> to access my database.  And I know it won't work, because I've already done
> that, and it said:
>
> SEVERE: Unable to deploy collapsed ear in war /ReachingRecovery: Exception:
> Creating application failed:
> C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\build\web:
> java.util.concurrent.ExecutionException: java.lang.ClassNotFoundException:
> org.eclipse.persistence.jpa.PersistenceProvider:
> java.lang.ClassNotFoundException:
> org.eclipse.persistence.jpa.PersistenceProvider
> org.apache.openejb.OpenEJBException: Creating application failed:
> C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\build\web:
> java.util.concurrent.ExecutionException: java.lang.ClassNotFoundException:
> org.eclipse.persistence.jpa.PersistenceProvider:
> java.lang.ClassNotFoundException:
> org.eclipse.persistence.jpa.PersistenceProvider
>
> I'm stumped.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/EclipseLink-TomEE-tp4656073p4656076.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: EclipseLink + TomEE?

Posted by miweiss <ho...@yahoo.com>.
Hmm.  Are you saying delete the EclipseLink JPA from my app?  I'm using JPA
to access my database.  And I know it won't work, because I've already done
that, and it said:

SEVERE: Unable to deploy collapsed ear in war /ReachingRecovery: Exception:
Creating application failed:
C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\build\web:
java.util.concurrent.ExecutionException: java.lang.ClassNotFoundException:
org.eclipse.persistence.jpa.PersistenceProvider:
java.lang.ClassNotFoundException:
org.eclipse.persistence.jpa.PersistenceProvider
org.apache.openejb.OpenEJBException: Creating application failed:
C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\build\web:
java.util.concurrent.ExecutionException: java.lang.ClassNotFoundException:
org.eclipse.persistence.jpa.PersistenceProvider:
java.lang.ClassNotFoundException:
org.eclipse.persistence.jpa.PersistenceProvider

I'm stumped.

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

Re: EclipseLink + TomEE?

Posted by David Blevins <da...@gmail.com>.
On Jul 5, 2012, at 6:05 PM, miweiss wrote:

> I'm having trouble starting TomEE, and it's because of this error:
> 
> <code>
> SEVERE: Unable to deploy collapsed ear in war /ReachingRecovery: Exception:
> Creating application failed:
> C:\Users\Mimi\Documents\NetBeansProjects\ReachingRecovery\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

> I don't see any JPA libraries (okay, except that one - I've already deleted
> it) in the TomEE distribution, so I don't understand what's going on.  Can
> somebody help?

Looks like you have the JPA API library in our webapp.  Delete that and you should get further.

Note the server itself needs the JPA API and it's located in the javaee-api jar. OpenJPA is optional and it is safe to delete that.


-David