Exclude implicit modules in jboss-deployment-structure.xml
white_crow May 31, 2017 4:51 AMHello there
We have a web application (WAR) running on Wildfly 10.0.0 FINAL. We're currently facing some library conflicts: Because we provide many different features (like REST, web service security, JAXB and Jackson), we very carefully need to put together our dependencies, since they have lot of dependencies in common. That's why we want to pack many of the stuff with our WAR deployment and not use installed versions on Wildfly.
Reading the documentation, I clearly understand that there are some implicit modules (Implicit module dependencies for deployments - WildFly 10 - Project Documentation Editor) which are either always loaded or only if a certain precondition is met. Most of them are stuff from the JavaEE API. The implicit modules are basically listed in the javaee.api module ([WILDFLY-FOLDER]/modules/system/layers/base/javaee/api/main/module.xml). Further, it is mentioned in the docu, that one has full control over modules being loaded by the classloader - by either defining an explicit include of a module or by an explicit exclude of any implicit module or subsystem.
Long story short: We are now trying to exclude some of the implicit modules being loaded by the classloader, however, it seems not to work... Are we doing something wrong here, or is this a known bug? Because I've seen many other threads in this forum with the same problem, but none got really an answer:
Re: Exclude RESTeasy from deployment in JBoss EAP 6.4.9
Module not excluded although specified in jboss-deployment-structure.xml
common libraries, modules & implicit dependency
As an example, we have something like this in our jboss-deployment-structure.xml:
<jboss-deployment-structure>
<deployment>
<exclude-subsystems>
<subsystem name="webservices"/>
<subsystem name="jaxrs"/>
</exclude-subsystems>
<exclusions>
<module name="javax.jws.api"/>
<module name="javax.xml.ws.api"/>
<module name="javax.ws.rs.api"/>
....
Excluding the subsystem somehow does a change. However, the exclusions of modules seem to be ignored. We could verify this by using the -verbose:class JVM option: Comparing the outputs once without exclusions an once with exclusions in place -> no change at all!
One thought I had - but not tried yet - will it maybe make a difference, if deploying instead of just a WAR, an the WAR inside an EAR? So one could work with sub-deployments in the jboss-deployment-structure.xml
This is quite frustrating, because we really like the idea of modules. But if this does not work, we would have to patch some existing modules on Wildfly, which we really trying to avoid by all means...
Thanks a lot,
Cheers