Search code examples
javajarearwebsphere-6.1

What I have to do to guarantee that ccc.jar is loaded before aaa.jar?


Does somebody know in which order of precedence are the jars loaded?

Having several jars in WEB-INF/lib (in a war inside an ear in WAS 6.1).

Let's say aaa.jar, bbb.jar, ccc.jar. I have two different versions of a class paq1.paq2.paq3.MyClass inside aaa.jar and ccc.jar

The one inside ccc.jar is the correct one; the one in the aaa.jar is the wrong.

It seems that the wrong version is localized before the correct one.

Does somebody know what I have to do to guarantee that ccc.jar is loaded before aaa.jar?

(This is a simplification of a more real/complex problem, so renaming jars doesn't apply in this case).

Thank you in advance


Solution

  • WebSphere Application Server makes no guarantees about the ordering of JARs within WEB-INF/lib, and there is no option to force a particular ordering. I recommend removing duplicate classes and resources.