My subdeployment is getting ClassCastExceptions in EAP 6
Issue
- I can't get JBoss to exclude a Java EE component from my deployment even though I've added an exclusion for it in
jboss-deployment-structure.xml. - When migrating an application to EAP6 I get
ClassCastExceptions for classes provided by JBoss. - I have an .ear with a .war subdeployment. I am including my own implementation of something that JBoss already provides (e.g. Hibernate, JAX-WS runtime, Log4J, JAX-RS runtime). I've correctly added exclusions for the component I'm using to
jboss-deployment-structure.xml, but I'm still gettingClassCastExceptions. What am I doing wrong? Here is myjboss-deployment-structure.xml(this example shows Log4J):
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<exclusions>
<module name="org.apache.log4j" />
<module name="org.jboss.log4j.logmanager" />
</exclusions>
...
</deployment>
<sub-deployment name="test.war">
<exclusions>
<module name="org.apache.log4j" />
<module name="org.jboss.log4j.logmanager" />
...
</exclusions>
...
</sub-deployment>
</jboss-deployment-structure>
Environment
- JBoss Enterprise Application Platform (EAP) 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.