We have jaxen.jar in the server/xxx/lib directory for our ejb.jar. However, we also use the JSTL in our .wars, and it has it's own jaxen.jar--different version. We end up with Class confilcts because the .wars actually end up with jaxen.jar classes that have previously been instantiated from the server/xxx/lib directory trying to interact with classes from their own /WEB-INF/lib/jaxen.jar.
Is this a case of the Unified ClassLoader working against us? By spec, shouldn't a .war put everything in its own /WEB-INF/lib directory ahead of any other libraries?
Any JBoss gurus out there know how to fix this?
(JBoss 3.2.1, JDK 1.4.1)
Java 2 classloading compliance is followed by default in the embedded servlet containers. You can turn this off by editing the relevant META-INF/jboss-service.xml for the jbossweb container SAR. Look for a line like:
There are also copious notes in the config file explaining what this means. Essentially, without Java 2 compliance, your web app should try its own classloader first.
People have had varied success with this with regard to their class recognition problems. Some people have also suggested bundling in an EAR and specifying the JARs explicitly in the EAR deployment.