I'm in the process of updating a legacy application from WildFly 24 to WildFly 26.
Some time ago I converted this application from Java 8 to Java 11 all running on WildFly 15. At the time, I converted some projects to be modularized using module-info.java files, but not all.
For the next version of the application I upgraded to WildFly 24. This was relatively painless. The app got shelved for several months. That version was never released and now I'm updating to WildFly 26. I'm having one general problem in this process. My .ear application has some code that does XML schema parsing and uses an XML catalog. This means I'm using the following dependencies:
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.2</version>
</dependency>
In the project containing the EJBs, I use these as provided scope since WildFly has these modules. In my EAR project, I'm adding Dependencies entry to the manifest:
<archive>
<manifestEntries>
<Dependencies>javax.ws.rs.api, org.dom4j, org.infinispan, org.apache.xml-resolver, org.apache.xerces</Dependencies>
</manifestEntries>
</archive>
When my .ear
is deployed and that code is invoked, I get the following:
Caused by: java.lang.ClassNotFoundException: org.apache.xml.resolver.readers.CatalogReader from [Module "org.apache.xerces" version 2.12.0.SP03 from local module loader @20c0a64d (finder: local module finder @455b6df1 (roots: /opt/wf_app/modules,/opt/wf_app/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 80 more
Things I've tried: Adding global-modules entries for the two existing built-in wildfly modules
/subsystem=ee:list-add(name=global-modules,value={name=org.apache.xml-resolver,slot="main",meta-inf="true",services="true"})
/subsystem=ee:list-add(name=global-modules,value={name=org.apache.xerces,slot="main",meta-inf="true",services="true"})
I've tried adding entries in the jboss-deployment-structure.xml
in the EAR. I've even tried adding copies of the two JARs to the standalone/lib/ext
directory to make them available.
In no way is WildFly allowing the EAR and sub-deployments to see these classes.
Any thoughts?