I did not think that I would get here, but after many searches of Google and StackOverflow I am here.
This is my exact problem , except that I cannot afford to modify the code.
The WAR I'm trying to deploy includes a JMS library (i.e. javax.jms, which I cannot exclude from WAR), which is already loaded by default with Jboss EAP 7. The path to the jar looks something like this: jboss/modules/system/layers/base/javax/jms/api/ain/jboss-jms-api_2.0_spec-1.0.0.Final-redhat-1.jar . Due to these two different loading versions of the same classes, I get a ClassCastException.
org.apache.activemq-ra.ActiveMQConnectionFactory cannot to be cast to javax.jms.ConnectionFactory
So, I want Jboss to NOT load javax.jms so that my application can use the JAR included in the WAR.
So, I was wondering if there is a way to exclude the module globally (for all WAR deployments).
Other than that, deployment will work too. And I understand that this can be useful with jboss-deployment-structure.xml, but I can't get it to work.
Here is what I tried:
<?xml version="1.0" encoding="UTF-8"?> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"> <deployment> <exclude-subsystems> <subsystem name="javax" /> <subsystem name="javax.jms" /> </exclude-subsystems> </deployment> </jboss-deployment-structure>
and
<?xml version="1.0" encoding="UTF-8"?> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"> <deployment> <exclusions> <module name="javax" /> <module name="javax.jms" /> <module name="javax.jms.api" /> </exclusions> </deployment> </jboss-deployment-structure>
I put the file in the WEB-INF directory. This did not work. It still loaded the JMS class from the Jboss EAP modules folder. So how did I do it right?
java jboss jboss-eap-7
Dilip raj baral
source share