Jboss and Wildfly do not appear to load all of rt.jar (and other Jave jre jars)
brian_parker Oct 13, 2016 2:53 PMIn Jboss 7.1.1, we were getting the following error :
decryption error: java.lang.NoClassDefFoundError: javax/crypto/spec/PBEParameterSpec
It was getting logged very often causing the log files to grow quite large.
We had added a global module by adding
<global-modules>
<module name="org.jboss.wisl" slot="main"/>
</global-modules>
to the
<subsystem xmlns="urn:jboss:domain:ee:1.1">
in the standalone.xml file.
We had created the module.xml and copied a couople of jars into a directory called org/jboss/wisl/main. We foudn we had to copy the jce, jsee and rt jars from the Jave jre directory into this global module directory and set the module.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.jboss.wisl">
<resources>
<resource-root path="RedBeans.jar"/>
<resource-root path="asjava.jar"/>
<resource-root path="jce.jar"/>
<resource-root path="jsse.jar"/>
<resource-root path="rt.jar"/>
</resources>
<dependencies>
<module name="javax.api" slot="main" export="true" />
</dependencies>
</module>
The above stopped the error.
When we moved to Wildfly 9.0.1, we were also getting the above error. In Wildfly 9.0.1, we added
<global-modules>
<module name="org.jboss.wisl" slot="main"/>
</global-modules>
to the
<subsystem xmlns="urn:jboss:domain:ee:3.0">
of standalone.xml . Without the jce, jsse and rt jars we were getting the "decryption error: java.lang.NoClassDefFoundError: javax/crypto/spec/PBEParameterSpec" error. We added the jars and change the module.xml as above and not we get the following errors:
decryption error: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "javax/security/auth/x500/X500Principal"
decryption error: java.lang.NoClassDefFoundError: Could not initialize class sun.security.x509.X500Name
The loader constraint error is logged the one time and the sun.security.x509.X500Name error gets logged numerous time, making the logs grow quite large.
Is there a better way to have Jboss/Wildfly load the Java/jre/lib jars so that the errors do not occur?
is there another jar or dependency that I need to add the wisl/main/module.xml to address the 'decryption error: java.lang.NoClassDefFoundError: Could not initialize class sun.security.x509.X500Name" error in Wildfly?