Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Does WebSphere Choose the Classloading Order in a Folder (WEB-INF/lib)

I am currently facing an interesting problem where our application fails to start up on 3/4 nodes due to classloading issues.

The problem seems to be that WAS is loading b.jar before a.jar. After troubleshooting more, I found that all of the nodes load the jars in different orders (via Classpath viewer in console) and the working node may have just been a fluke.

How does WebSphere determine the classloading order within an installed applications WEB-INF/lib folder?

like image 925
leeman24 Avatar asked Dec 13 '25 02:12

leeman24


1 Answers

Order of loading jars is undefined in websphere. To solve your problem I can suggest you to use one of the below option.

Use manifest classpath settings by mentioning the jar names in a order like how you want them to be loaded.

OR

You can extract the classes from a.jar and put it in the WEB-INF/classes directory. Then remove a.jar from the lib folder. Because classes directory will be loaded before lib directory.

like image 196
Satheshkumar Avatar answered Dec 15 '25 17:12

Satheshkumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!