Search code examples
jakarta-eeclassloadernoclassdeffounderrorjdomjboss-eap-6

NoClassDefFoundError org/jaxen/JaxenException in Jboss EAP6


I deploy my code in Jboss EAP6 ear's /lib folder, it calls org.jdom.XPath.newInstance(), which calls org.jdom.JaxenXPath, which calls the org.jaxen package.

I do have the Jaxen JAR in my Jboss core modules at jboss\modules\system\layers\base\org\jaxen\main\jaxen-1.1.3.redhat-4.jar

But still, I get a NoClassDefFoundError for org/jaxen/JaxenException (and I guess for all the package). If I copy that jaxen JAR in my ear's /lib folder, the error disappears, so I guess it's a Jboss classloader issue, but I used Jboss modules packages before and it never happened. What is going on?

PS : This thread doesn't help.


Solution

  • The Jaxen Jboss module is private (see module.xml in the same folder as the JAR). I had to add the following line to my calling JAR's manifest:

    Dependencies: org.jaxen