0 Replies Latest reply: Apr 13, 2012 8:23 AM by qtm RSS

jboss 4.2.3 and hibernate 4 - ear isolation

qtm Newbie



I'm trying to make hibernate 4 work with jboss 4.2.3. I can't remove the default hibernate files from server/[my_config]/lib so I need to deploy an ear with the Hibernate4 jars included.

The ear structure is :

- lib : all jars needed for hibernate 4 here


      - application.xml

      - jboss-app.xml

-myCustom.jar (an ejb jar with a persistence.xml file in its META-INF folder).


I've tried to use isolation in jboss-app.xml (see below), but I can't get it to work:


  <!DOCTYPE jboss-app

    PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"








I've tried org:archive=TestHS.ear too.


The error is :

java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot be cast to javax.persistence.spi.PersistenceProvider

    at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:245)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


Can anyone help me with the isolation?