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

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.

Related

Jboss EAP7/Wildfly Oracle datasource error: Services with missing/unavailable dependencies

I'm using Jboss EAP 7.1 now, recently I add the Oracle datasource to the server as the datasource I correctly configured before. But I got the error message:
Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.CreditDS is missing [jboss.jdbc-driver.oracle11g]"
CreditDs is my JNDI name and oracle11g is the driver name. Here are my configuration:
<!-- standalone.xml -->
<datasource jndi-name="java:jboss/datasources/CreditDS" pool-name="CreditDS" enabled="true">
<connection-url>jdbc:oracle:thin:#***</connection-url>
<driver>oracle11g</driver>
…… …… ……
</datasource>
<drivers>
<driver name="oracle11g" module="com.oracle.ojdbc14">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
Here is the modules.xml in modules/com/oracle/ojdbc14/main
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle.ojdbc14">
<resources>
<resource-root path="ojdbc14-10.2.0.4.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
What's wrong?
I guess your oracle module is not recognized correctly.
The procedure for adding oracle JDBC module is as follows:
1 create folder com/oracle/ojdbc14/10.2.0.4.0 withing JBOSS_HOME/modules directory
2 copy your oracle jar file to the folder and add a module.xml with the following contents
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.oracle.ojdbc14" slot="10.2.0.4.0">
<resources>
<resource-root path="ojdbc14-10.2.0.4.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
3 Create driver definition in standalone.xml
<driver name="oracle14" module="com.oracle.ojdbc14:10.2.0.4.0">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
Couple of things to note:
Do pay attention to correct version of JBoss modules XMLNS - you tagged your questions with EAP7 - so you should use xmlns 1.3.
Note the slot value in both modules.xml and driver definition. This could be any value, but it is a good practice to use the lib version.
After adding any modules into JBoss, you need to restart it completely(restart JVM).
Lastly, you should use an up-to-date version of Oracle JDBC driver as ojdbc14 are not supported anymore, so it should be like this:
Module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.oracle.ojdbc7" slot="12.1.0.2">
<resources>
<resource-root path="ojdbc7-12.1.0.2.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
Folder modules/com/oracle/ojdbc7/12.1.0.2
Driver:
<driver name="oracle7" module="com.oracle.ojdbc7:12.1.0.2">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>

stackoverflow while integrating eclipselink with jboss eap 6

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

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.

JBoss AS 7.1.1 Final and Log4j-extras

I want to add log4j-extras jar in my jboss server but i don't know how to do this correctly.
I put apache-log4j-extras-1.2.17.jar into jboss_HOME/modules\org\apache\log4j\main (same location as log4j-1.2.16.jar) and my module.xml looks like :
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.log4j">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<resources>
<resource-root path="log4j-1.2.16.jar"/>
<!-- Insert resources here -->
<resource-root path="apache-log4j-extras-1.2.17.jar"/>
</resources>
<dependencies>
<module name="org.dom4j" optional="true"/>
<module name="javax.api"/>
<module name="org.jboss.logmanager"/>
<module name="org.jboss.modules"/>
</dependencies>
</module>
After start jboss, i have new files in the directory :
apache-log4j-extras-1.2.17.jar.index and log4j-1.2.16.jar.index
I have an application which use an external log4j.properties.
The configuration is ok but when i try to add "log4j.appender.test=org.apache.log4j.rolling.RollingFileAppender", i have the error message "log4j:ERROR Could not instantiate class [org.apache.log4j.rolling.RollingFileAppender]"
So i guess that the add of log4j-extras is not ok.
Can someone tell me the correct configuration to do in jboss ? (maybe the module.xml is not correct or i need to create an other directory in module ?)
Thanks a lot !

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>