posted 21 years ago
The Delegation Mode for the CompoundClassLoader is true in J2EEApplication Mode whereby it was false in Application Mode. This creates unfortunate behavior.
This means that classes that my utility jar file depends on are first loaded by the bootstrap classloader (or something higher up in the priority tree). For something like log4j, this has the unfortunate consequence of making my appender invisible to log4j, as my appender is included in my utility class.
Here are the jar's in play:
ear
war
lib/util.jar (manifest classpath points to ../vendor/log4j.jar)
vendor/log4j.jar
A different log4j.jar somewhere else in war's classpath.
With DelegationMode turned on, not only to I not get the expected version of log4j.jar from my vendor library, but log4j gets loaded by the bootstrap classloader or the ExtClassLoader and classes in util.jar are inaccessible to it. This has created conflicts for every jar file included in the server's bootstrap classpath, e.g. xerces, xalan, jaxp, etc.
Is there any way to override this? ejbDelegationMode doesn't do it. I am stuck using Application or Server mode.