문제

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

도움이 되었습니까?

해결책 3

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.

다른 팁

I don't believe the servlet specification guarantees any specific Classpath ordering for the jars in the lib-folder. Hence you are looking at vendor specific functionality or - even worse - vendor specific accidental behavior, which tends to be very brittle.

If the bad class is in your deployment, the cure is removing the bad class definitions from your deployment. I would suggest that your build procedure is responsible for this.

If the bad class is in WAS itself you can usually override it by putting jars in an extension folder in the server itself, not as part of your deployment.

JVM takes class from the first jar in class path, where appropriate class exists. All others are discarded. You can remove this jars from WEB-INF and put them directly to webserver's class path. But this will be ugly solution.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top