I was recently trying to solve class cast exception in our web application. After few tests have found out that the classloader information for our web application right after application server restart are different from classloader information after webapp restart/update (without app server restart).
Classloader information were retrieved using the Manage modules - View Module class loader - Export in the Websphere administration console.
The items (paths to webapp .jar files) in exported XML are the same. But some of the items (as I understand it - these are the classes in webapps' classloader) are different.
Could anybody explain why?
Thanks.
Update: Here is the difference which is maybe the main problem (I keep getting ClassCastException on XMLSignatureFactory in my log file). This class is contained in xmlsec library and this library is deployed with our webapp war file. The classloader order is set to PARENT LAST, but it seems like sometimes the XMLSignatureFactory from IBM JDK is loaded instead of the xmlsec implementation (after redeploy).
I have described the exception further in this post. After I have changed the settings in MANIFEST.MF file and set up the servlet listener, I could get the application working after every restart, but the redeploy problem still occurs (which is quite annoying).