stackoverflow while integrating eclipselink with jboss eap 6 - jpa

I am trying to deploy an application configured with eclipse link as jpa provider on jbosss eap 6.3
but it seems there is an issue between EclipseLink and jboss because i get a stackoverflow error while deploying
Failed to define class org.eclipse.persistence.internal.weaving.WeaverLogger in Module "deployment.test-service.war:main" from Service Module Loader: java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_74]
at org.jboss.as.server.deployment.module.VFSResourceLoader.getClassSpec(VFSResourceLoader.java:131) [jboss-as-server-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:268) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.Module.loadModuleClass(Module.java:568) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.eclipse.persistence.internal.jpa.weaving.PersistenceWeaver.transform(PersistenceWeaver.java:100)
at org.jboss.as.jpa.classloader.JPADelegatingClassFileTransformer.transform(JPADelegatingClassFileTransformer.java:48) [jboss-as-jpa-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at org.jboss.as.server.deployment.module.DelegatingClassFileTransformer.transform(DelegatingClassFileTransformer.java:60) [jboss-as-server-7.4.1.Final-redhat-3.jar:7.4.1.Final-redhat-3]
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:474) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.Module.loadModuleClass(Module.java:568) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.4.Final-redhat-1]
at org.eclipse.persistence.internal.jpa.weaving.PersistenceWeaver.transform(PersistenceWeaver.java:100)
Do i need to add some configuration to jboss(standalone.xml)?
There is my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="unit" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://*****" />
<property name="javax.persistence.jdbc.user" value="*****" />
<property name="javax.persistence.jdbc.password" value="****" />
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.logging.level" value="SEVERE"/>
</properties>
</persistence-unit>
</persistence>
My pom.xml(this project will be a dependency of another)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.maventest</groupId>
<artifactId>test-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../test-app</relativePath>
</parent>
<artifactId>test-repository</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>2.6.2</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>
</dependencies>
</project>
Any advices will be appreciated
Thank you very much

Thanks to Chris answer , i managed to run jboss eap 6 and EclipseLink by integrating eclipse link module inside jboss eap
I needed to create a new folder : JBOSS_ HOME\modules\org\eclipse\persistence\main and copy eclipselink.jar inside. Then i needed to create the module.xml associated
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.eclipse.persistence">
<resources>
<resource-root path="eclipselink.jar" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.persistence.api" />
<module name="javax.transaction.api" />
<module name="javax.validation.api" />
<module name="javax.xml.bind.api" />
<module name="org.antlr" />
<module name="org.apache.commons.collections" />
<module name="org.dom4j" />
<module name="org.javassist" />
<module name="org.jboss.logging" />
</dependencies>
</module>
Complete tutorial : https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide#JPAReferenceGuide-UsingEclipseLink and http://www.eclipse.org/eclipselink/documentation/2.5/solutions/jboss002.htm
Moreover despites my server ran smoothly after that but i got a new error after trying persisting any data "object is not a known entity type"
The problem was because in the persistence.xml i had the line <exclude-unlisted-classes>false</exclude-unlisted-classes>
It seems there is a classloading issue between eclipselink and jboss eap
I needed to declare explicitely entities by <class> attributes

Related

Wildfly 21 with eclipselink 3.0 getting error as Persistence Provider not found

Wildfly Version: 21.0.2.Final
JDK Version: openjdk-11.0.2
Eclipselink: Migrating from 2.7.8 to 3.0.0 ( 2.7.8 working fine)
When I try to deploy EJB 3.2 (JPA 2.2) project I am getting the below issue
10:29:59,261 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."AAA-EAR.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."AAA-EAR.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "AAA-EAR.ear"
at org.jboss.as.server#13.0.3.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
at org.jboss.msc#1.4.12.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc#1.4.12.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc#1.4.12.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javax.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.eclipse.persistence.jpa.PersistenceProvider' not found
at org.jboss.as.jpa#21.0.2.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:1001)
at org.jboss.as.jpa#21.0.2.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.nextPhaseDependsOnPersistenceUnit(PersistenceUnitServiceHandler.java:1044)
at org.jboss.as.jpa#21.0.2.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:137)
at org.jboss.as.jpa#21.0.2.Final//org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
at org.jboss.as.server#13.0.3.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
... 8 more
Eclipselink 2.7.8 working fine, so I just updated eclipselink version to 3.0 in below module.xml.
Also I think no need to exclude javax as this folder does not in eclipselink 3.0 jar.
wildfly-21.0.2.Final/modules/system/layers/base/org/eclipse/persistence/main/module.xml
<module name="org.eclipse.persistence" xmlns="urn:jboss:module:1.5">
<properties>
<property name="jboss.api" value="public"/>
</properties>
<resources>
<resource-root path="jipijapa-eclipselink-21.0.2.Final.jar"/>
<resource-root path="eclipselink-3.0.0.jar">
<filter>
<exclude path="javax/**" />
</filter>
</resource-root>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="javax.xml.bind.api"/>
<module name="org.antlr"/>
<module name="org.dom4j"/>
<module name="org.jboss.as.jpa.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.vfs"/>
</dependencies>
</module>
Below is my META-INF/persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="AAA-EJB" transaction-type="JTA">
<provider>**org.eclipse.persistence.jpa.PersistenceProvider**</provider>
<jta-data-source>java:/Test</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.jpa.uppercase-column-names" value="true"/>
<property name="eclipselink.query-results-cache" value="false"/>
<property name="eclipselink.refresh" value="true"/>
<property name="eclipselink.cache.shared.default" value="false"/>
<property name="eclipselink.deploy-on-startup" value="true" />
</properties>
</persistence-unit>
</persistence>
Eclipselink 2.7.8 working fine but getting issue for Eclipselink 3.0.
Please help. Thanks.

Caused by: java.lang.NoClassDefFoundError: Failed to link when running JUnit tests through Arquilliqn for a Maven project

So I'm trying to test a maven project using Arquilian on Eclipse for a school project, however when I try to run the test through mvn clean test I get the following stacktrace:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.361 sec {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testCapAnalogique.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"testCapAnalogique.war\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class fr.esisar.locVoiture.stateless.CapAnalogiqueStateless with ClassLoader ModuleClassLoader for Module \"deployment.testCapAnalogique.war\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: Failed to link fr/esisar/locVoiture/entities/CapAnalogique (Module \"deployment.testCapAnalogique.war\" from Service Module Loader): fr/esisar/locVoiture/entities/Capteur"}}}}
I'm using the following arquillian.xml:
<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<defaultProtocol type="Servlet 3.0" />
<container qualifier="jboss" default="true">
<configuration>
<property name="jbossHome">home/user/CS513-Archive/wildfly-
16.0.0.Final</property>
</configuration>
</container>
</arquillian>
And the following test-persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="test">
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>
and the test-ds.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd">
<!-- The datasource is bound into JNDI at this location. We reference
this in META-INF/test-persistence.xml -->
<datasource jndi-name="java:jboss/datasources/BeanValidationQuickstartTestDS"
pool-name="bean-validation-quickstart-test" enabled="true"
use-java-context="true">
<connection-url>jdbc:h2:mem:bean-validation-quickstart-test;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
with the dependencies in pom.xml:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.13.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>arq-managed</id>
<dependencies>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>2.1.0.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>arq-remote</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>2.1.0.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
Please note I'm new to Maven and arquillian and I may be missing something trivial.
So the problem was that I'm adding classes in my createArchiveTest() function as resources in the ShrinkWrap create method, that extend and implement other classes and interfaces. Turns out all of them actually need to be passed as resources.
Say you want to test a class called StudentA, but this class extends another class called Student and the Student class implements a Person interface, all three need to be passed as resources.

classloading problems with Wildfly 8.0.0

I am trying to deploy a Spring-JPA-Hibernate web application on Wildfly. First, I had problems with Hibernate which seemed to go away with
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.hibernate" slot="main" />
</exclusions>
<dependencies>
<module name="org.hibernate" />
</dependencies>
</deployment>
</jboss-deployment-structure>
then however, my org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean tried to parse its mappingResources (xml file), and I got the exception
Error while parsing (.... etc)
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildHibernateConfiguration(EntityManagerFactoryBuilderImpl.java:1163)
... 44 more
Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
which seems to suggest there is another dom4j on the classpath.
At this point I got lost, since tinkering again with jboss-deployment-structure.xml only made the server freeze with no error message soon after startup.
Is there a simple way just to tell Wildfly not to put on the classpath at least its dom4j (or better, not to add anything at all automatically)?
I think that you must choose a strategy to use the classes from Wildfly or to use the classes you provide in your application.
I have the similar issue with Liferay 6.2 GA3 deployed in Wildfly 8.2. I solved it using a deployment descriptor similar to:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.hibernate"/>
<module name="org.hibernate.validator"/>
<module name="org.jboss.as.jpa"/>
<module name="org.javassist"/>
<module name="javaee.api"/>
</exclusions>
<dependencies>
<!-- add the module and remove the dom4j in your application
or exclude the module and add the jar in your application -->
<module name="org.dom4j"/>
<module name="javax.mail.api"/>
<module name="org.apache.xerces"/>
<module name="org.jboss.modules"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
https://www.liferay.com/community/forums/-/message_boards/view_message/40321431#_19_message_47754919
If you want to use the Wildfly classes and deploy the JPA entities in Wildfly container, use a similar persitence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="MyApp" transaction-type="JTA" >
<!-- Data Source -->
<jta-data-source>java:jboss/datasources/MyApplicationPool</jta-data-source>
<!-- Class -->
<class>entities here </class>
<!-- Properties -->
<properties>
<!-- the persitence unit will be deployed in Wildfly and linked to spring
using JNDI https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide#JPAReferenceGuide-BindingEntityManagerFactory%2FEntityManagertoJNDI -->
<property name="jboss.entity.manager.factory.jndi.name" value="java:jboss/WildflyEntityManagerFactory" />
<property name="jboss.entity.manager.jndi.name" value="java:/WildflyEntityManagerVMS" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<!-- for the JODA datetime -->
<property name="jadira.usertype.autoRegisterUserTypes" value="true" />
</properties>
</persistence-unit>
Make reference to the Wildfly persitence unit in your Spring application:
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<jee:jndi-lookup id="entityManagerFactory"
jndi-name="java:jboss/WildflyEntityManagerFactory" expected-type="javax.persistence.EntityManagerFactory" />
And you should not need any specific jboss-deployment-structure.

Problems creating jms bridge in wildfly8

Im trying to create a jms bridge from WildFly 8 to openmq. Every example i tried did not work. Can someone help me. I never have created a jms bridge before.
The jms-bridge entry in my standalone-full.xml
<source>
<connection-factory name="jms/ConnectionFactory"/>
<destination name="jms/TestQueue"/>
<context>
<property key="java.naming.factory.initial" value="com.sun.enterprise.naming.SerialInitContextFactory"/>
<property key="java.naming.provider.url" value="mq://localhost:7676"/>
</context>
</source>
<target>
<connection-factory name="jmsConnectionFactory"/>
<destination name="/"jms/TestQueue"/>
</target>
<quality-of-service>AT_MOST_ONCE</quality-of-service>
<failure-retry-interval>500</failure-retry-interval>
<max-retries>1</max-retries>
<max-batch-size>500</max-batch-size>
<max-batch-time>500</max-batch-time>
<add-messageID-in-header>true</add-messageID-in-header>
</jms-bridge>
I created a module from imqjmsra.rar.
The module.xml
<resource-root path="fscontext.jar"/>
<resource-root path="imqbroker.jar"/>
<resource-root path="imqjmsbridge.jar"/>
<resource-root path="imqjmsra.jar"/>
<resource-root path="imqjmx.jar"/>
<resource-root path="imqstomp.jar"/>
<!-- add the dependencies required by JMS Bridge code -->
<module name="javax.api" />
<module name="javax.jms.api" />
<module name="javax.transaction.api"/>
<module name="javax.resource.api"/>
The error that i get is
2014-04-04 14:36:04,846 WARN [org.hornetq.jms.server] (pool-3-thread-1) HQ122010: Failed to connect JMS Bridge: javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory com.sun.enterprise.naming.SerialInitContextFactory from classloader ModuleClassLoader for Module "org.glassfish:main" from local module loader #6b573f80 (finder: local module finder #2d0a238e (roots: C:\Installs\JBoss\wildfly-8.0.0.Final\modules,C:\Installs\JBoss\wildfly-8.0.0.Final\modules\system\layers\base)) [Root exception is java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory from [Module "org.glassfish:main" from local module loader #6b573f80 (finder: local module finder #2d0a238e (roots: C:\Installs\JBoss\wildfly-8.0.0.Final\modules,C:\Installs\JBoss\wildfly-8.0.0.Final\modules\system\layers\base))]]
at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:116)
at org.jboss.as.naming.InitialContext.init(InitialContext.java:99)
at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:153) [rt.jar:1.7.0_45]
at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:90)
at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:44)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684) [rt.jar:1.7.0_45]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307) [rt.jar:1.7.0_45]
at javax.naming.InitialContext.init(InitialContext.java:242) [rt.jar:1.7.0_45]
at javax.naming.InitialContext.<init>(InitialContext.java:216) [rt.jar:1.7.0_45]
at org.hornetq.jms.bridge.impl.JNDIFactorySupport.createObject(JNDIFactorySupport.java:53)
at org.hornetq.jms.bridge.impl.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:38)
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjects(JMSBridgeImpl.java:1217)
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjectsWithRetry(JMSBridgeImpl.java:1457)
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.access$2000(JMSBridgeImpl.java:76)
at org.hornetq.jms.bridge.impl.JMSBridgeImpl$FailureHandler.run(JMSBridgeImpl.java:2046)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
I figured it out. I needed to change module.xml file to
<module xmlns="urn:jboss:module:1.0" name="org.glassfish">
<resources>
<resource-root path="glassfish-embedded-all-3.1.1.jar"/>
</resources>
<dependencies>
<system export="true">
<paths>
<path name="sun/corba"/>
</paths>
</system>
<module name="javax.api" />
<module name="javax.jms.api" />
<module name="javax.transaction.api"/>
<module name="javax.resource.api"/>
<module name="javax.rmi.api"/>
</dependencies>
</module>

Missing class org.hibernate.ejb.hibernatePersistence in a maven web project

I am building a maven web project ( jsf+ejb3+jpa2) named " tuto.maven" using eclipse kepler, glassfish4.0, postgresSql 9.1, but where I try to run the project on a server a problem occurs
"cannot Deploy tuto.maven
deploy is failing=Error occurred during deployment: Exception while preparing the app : java.lang.ClassNotFoundException: org.hibernate.ejb.HibernatePersistence "
Here is the persistence.xml :
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation= "http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="persistence" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/postgres</jta-data-source>
<class>org.model.User</class>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
and pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.tuto</groupId>
<artifactId>tuto.maven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<repositories>
<repository>
<id>oss.sonatype.org</id>
<name>OSS Sonatype Staging</name>
<url>https://oss.sonatype.org/content/groups/staging</url>
</repository>
<repository>
<id>java.net</id>
<url>http://download.java.net/maven/2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.0.1B</version>
</dependency>
</dependencies>
</project>
any idea please .
It was a problem of version, I use the latest version and it works.
Make sure you have the jar's and search for prg.hibernate.ejb.HibernatePersistence class in your jars.
You also need to add in your persistence unit. Mention the name of the domain class.
<class>yourpackage.class</class>