-
1. Re: Is there a way to coax the ModuleClassLoader into referencing XSD files from Spring JARs?
jaikiran Sep 4, 2019 11:50 AM (in response to ehodges)ehodges wrote:
Is there some way to do this that I haven't been able to find? It seems like if our code can reference the Spring class files, it ought to be able to reference the XSD and "spring.schemas" files located in the Spring JARs.
Can you post the output of the following command, against one such specific spring jar:
jar -tf <that-spring-jar>
Also post the exact location (within?) the deployment where this spring jar is located and any code that you use to load/refer to those xsd files and/or the "spring.schemas" files.
-
2. Re: Is there a way to coax the ModuleClassLoader into referencing XSD files from Spring JARs?
ehodges Sep 4, 2019 12:09 PM (in response to jaikiran)You can see it for yourself in the "spring-beans-4.3.9.RELEASE.jar". There are 464 lines of text output by jar -tf.
The spring JAR is in the root of our EAR.
Our code doesn't refer to the XSD file or spring.schema directly. Our code just uses Spring, which loads its beans from XML files. Those XML files reference the XSD file to define their schema. Inside the Spring parsing code, it has its own schema handlers that will try to load the XSD files from Spring JARs before looking for them on the internet. The Spring code expects to be able to reference all of the resources in the Spring JARs while it is parsing the Spring bean XML files. The JBoss/WildFly module class loader prevents that.
-
3. Re: Is there a way to coax the ModuleClassLoader into referencing XSD files from Spring JARs?
jaikiran Sep 4, 2019 12:12 PM (in response to ehodges)ehodges wrote:
The spring JAR is in the root of our EAR.
The jars at the root of the EAR aren't considered "libraries" and are instead checked for being sub-deployments. Can you move those spring jars into a .ear/lib/ directory (create the lib directory at the root of the .ear, if there isn't one)? That should make it available in the classpath of the deployed application. If it still fails to do what you are after, report back here and we can take a deeper look.
-
4. Re: Is there a way to coax the ModuleClassLoader into referencing XSD files from Spring JARs?
ehodges Sep 4, 2019 12:27 PM (in response to jaikiran)Thank you! That seems to solve the problem.