2 Replies Latest reply on Jun 3, 2013 6:49 AM by Unice Gwe Mbuamuh

    Using JPA 2.1 on JBoss EAP 6.1

    Unice Gwe Mbuamuh Newbie

      Hi, does anyonee have experience using jpa 2.1 on JBoss EAP 6  or JBoss 7? I am using JBoss EAP 6.1 Alpha as well as Beta to create an application managed entity manager. I keep getting a NoClassDefFoundError as follows:

       

      Caused by: java.lang.NoClassDefFoundError: org/hibernate/engine/spi/CascadeStyles$BaseCascadeStyle

      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:470) [hibernate-entitymanager-4.3.0.Beta1.jar:4.3.0.Beta1]

      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:193) [hibernate-entitymanager-4.3.0.Beta1.jar:4.3.0.Beta1]

      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:173) [hibernate-entitymanager-4.3.0.Beta1.jar:4.3.0.Beta1]

      at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:43) [hibernate-entitymanager-4.3.0.Beta1.jar:4.3.0.Beta1]

      at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:121) [hibernate-entitymanager-4.3.0.Beta1.jar:4.3.0.Beta1]

      at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:67) [hibernate-entitymanager-4.3.0.Beta1.jar:4.3.0.Beta1]

      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) [hibernate-jpa-2.1-api-1.0.0.Draft-16.jar:1.0.0.Draft-16]

      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39) [hibernate-jpa-2.1-api-1.0.0.Draft-16.jar:1.0.0.Draft-16]

      at com.ec.eccore.util.security.ObjectAccessInfoVer3.initEntityManagerFactory(ObjectAccessInfoVer3.java:101) [com.ec.eccore-ejb-0.0.1-SNAPSHOT.jar:]

       

      I added hibernate-jpa-2.1-api-1.0.0.Draft-16.jar to jboss-eap-6.1Beta\modules\system\layers\base\javax\persistence\api\main, and put it in my module.xml file, so as to use jpa 2.1. Then i packaged its hibernate dependencies from my project in the ear file, as adviced in http://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Draft-16. Does anyone know what i might be missing or have added to get the error? Or how do you go about using jpa 2.1 in jboss eap 6? Thank you.