I deploy a resource-adapter for JMS. The rar file includes a jar file containing the resource-adapter implementation and JMS client libraries for the JMS provider along with the JNDI classes needed to connection to that JMS Provider. (the JMS provider isn't JBoss).
I can deploy the rar file successfully.
I try to deploy a Message Driven Bean and get the following error
Caused by: java.lang.RuntimeException: javax.resource.NotSupportedException: failure looking up resource provider factory for GenericXAConnectionFactory [XA Unified]-OracleJMSConnector.GenericXAConnectionFactory.adc2100774.us.oracle.com.-38dcaf4a:1365a5ba0ca:-8000.5 : javax.resource.ResourceException: Error creating naming context instance: JBAS011843: Failed instantiate InitialContextFactory oracle.j2ee.jms.v1.NamingFactory from classloader ModuleClassLoader for Module "org.jboss.as.ee:main" from local module loader @141bcd49 (roots: /scratch/jleinawe/jboss71/new/jboss-as-7.1.1.Final-SNAPSHOT/modules)
So I go to jboss-as-7.1.1.Final-SNAPSHOT/modules/org/jboss/as/ee/main and in module.xml:
I add my client libaries under <resources/>
and I copy myClientLibrary.jar to jboss-as-7.1.1.Final-SNAPSHOT/modules/org/jboss/as/ee/main
I try to deploy the MDB again, this time it complains about javax.jms.JMSException
Caused by: javax.naming.CommunicationException: Unable to establish connection with server. There may be a network issue, the server may be down, or the connection address may be incorrect. (build: 02af) [Root exception is java.lang.NoClassDefFoundError: javax/jms/JMSException]
I go back to jboss-as-7.1.1.Final-SNAPSHOT/modules/org/jboss/as/ee/main/module.xml
and add this dependency
I can now get my MDB to work.
In other application servers, I can deploy this rar file and the mdb without having to do anything within the app-server to overcome class loading issues. They manage to find the required classes in the rar file and don't need to be tweaked so the app-server can find the JMS interfaces.
I deploy the rar, then the ear by dropping them in the standalone/deployments directory. I am using JBoss AS7.
What do I have to differently to get classloading to work with RARs and MDBs with JBoss 7? While the steps above worked for me, they feel like a hack.