Class Loading issue in websphere

1.3k Views Asked by At

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

1

There are 1 best solutions below

1
Ravi Bhavsar On

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.