You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Dain Sundstrom <da...@iq80.com> on 2008/05/15 18:30:59 UTC
Re: problem with hibernate persistence provider
Is this an error we should be checking for in the verifier?
-dain
On May 14, 2008, at 9:42 PM, David Blevins wrote:
> On May 14, 2008, at 5:46 AM, rolber wrote:
>
>> Caused by: org.apache.openejb.OpenEJBException:
>> java.lang.ClassCastException:
>> org.hibernate.ejb.HibernatePersistence cannot
>> be cast to javax.persistence.spi.PersistenceProvider:
>> org.hibernate.ejb.HibernatePersistence cannot be cast to
>> javax.persistence.spi.PersistenceProvider
>> at
>> org
>> .apache
>> .openejb
>> .assembler.classic.Assembler.createApplication(Assembler.java:459)
>> ... 17 more
>> Caused by: java.lang.ClassCastException:
>> org.hibernate.ejb.HibernatePersistence cannot be cast to
>> javax.persistence.spi.PersistenceProvider
>> at
>> org
>> .apache
>> .openejb
>> .assembler
>> .classic
>> .PersistenceBuilder
>> .createEntityManagerFactory(PersistenceBuilder.java:178)
> [...]
>> The library which uses hibernate, contains a package(ejb3-
>> persistence.jar)
>> which also uses the class javax.persistence.spi.PersistenceProvider,
>> the same as in javaee-api-5.0-1.jar package.
>
> The ClassCastException is definitely caused by having two copies of
> the javax.persistence APIs in your system (one in the common
> classloader provided by us and the one in your webapp). You'll
> definitely want to get rid of the jar in your webapp that contains
> the javax.persistence API. Assuming that jar only contains javax.*
> classes, everything should run fine without it.
>
> -David
>