We have a production server which is a websphere instance, where we copied a jar (say, c.jar which is already existing in EAR and overriden now) to EAR which is already deployed as a hot fix. I have class A, referring class B in the same Jar that is c.jar, and While loading class A, class B was unable to find and resulting in a NoClassFoundError. Hot deployment in the server is disabled. However, after restarting the server A is able find B. Any property we are missing? Why class B is not found although present in the same jar, but after restart it is able to find. Also, before copying the jar, the Old c.jar is working fine with class A and class B loaded. We are using was 6.1
Asked
Active
Viewed 1,248 times
0
-
Did you restarted the application after changes? See here - http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/trun_app_hotupgrade_app.html?lang=en for some more details. Copying jars directly is rather not recommended. Also 6.1 is way out of support now. You should migrate to newer version. – Gas Jan 21 '16 at 10:19
-
It worked fine after restart, but why is class loading issue appearing although classes are present in jar file. However, after restart it worked fine – Shakti Kumar Jan 22 '16 at 11:21
1 Answers
0
When application server start it creates the class files of application you deployed in your WAS JVM instance to make it available in runtime. As you explore the application other classes gets loaded. when you are deleting/overwriting the jar file you are breaking the link and thats the reason other classes could not find the classes there in c.jar. when you restart the JVM a new class files gets loaded in JVM runtime and you find it is available.

Ravi Bhavsar
- 39
- 7
-
Thanks for explanation, but this issue was not happening earlier. This is happening only now – Shakti Kumar Jan 22 '16 at 11:30