EclipseLink + TomEE?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

EclipseLink + TomEE?

miweiss
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!
Reply | Threaded
Open this post in threaded view
|

Re: EclipseLink + TomEE?

David Blevins-2

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

Reply | Threaded
Open this post in threaded view
|

Re: EclipseLink + TomEE?

miweiss
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.
Reply | Threaded
Open this post in threaded view
|

Re: EclipseLink + TomEE?

zeeman
In reply to this post by miweiss
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
Reply | Threaded
Open this post in threaded view
|

Re: EclipseLink + TomEE?

Jean-Louis MONTEIRO
In reply to this post by miweiss
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 <[hidden email]>

> 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.
>
   --
    Jean-Louis Monteiro
    http://twitter.com/jlouismonteiro
    http://www.tomitribe.com
Reply | Threaded
Open this post in threaded view
|

Re: EclipseLink + TomEE?

Romain Manni-Bucau
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" <[hidden email]> 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 <[hidden email]>
>
> > 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.
> >
>
Reply | Threaded
Open this post in threaded view
|

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

Neale Rudd
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

Reply | Threaded
Open this post in threaded view
|

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

Romain Manni-Bucau
Hi Neale,

We worked on trunk about it.

- Romain
Le 6 juil. 2012 08:49, "Neale Rudd" <[hidden email]> 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
>
>