Two days ago, I upgraded the hibernate version used by our app to Hibernate 4.2.8 primarily because of org.hibernate.engine.spi.EntityKey consumes a lot of memory. Unfortunately, javassist in Websphere is not yet updated which clashes with javassist-3.18.1-GA.jar used by hibernate 4.2.8.
I tried manually replacing ${WAS_ROOT_INSTALL}/plugins/javassist.jar with javassist-3.18.1-GA.jar (I know it’s not a good practice) but I got this error in SystemOut.log when I restarted Websphere.
... (I forgot to document the first lines) Caused by: java.lang.NoClassDefFoundError: com.ibm.ws.webcontainer.webapp.collaborator.WebAppCollaborator
So I restored the previous javassist.jar and restarted Websphere and for some weird reason, I think the entire websphere was messed up due to what I did because I got this error
[2/27/14 16:26:38:336 WIT] 00000001 ChannelFramew E CHFW0017E: Failed to load transport channel: com.ibm.wsspi.channel.framework.exception.ChannelException: Channel descriptor not found for HTTPQueueInboundChannel_1183122130078 at com.ibm.ws.channel.framework.impl.WSChannelFrameworkImpl.getChannelType(WSChannelFrameworkImpl.java:524)
and upon checking one of the FFDC emitted incident file, I still see Caused by: java.lang.NoClassDefFoundError: com.ibm.ws.webcontainer.webapp.collaborator.WebAppCollaborator
After hours of experimenting how to restore Websphere, I ended up calling for SOS.
So I experimented again using the other Websphere in other box. I set the classloader policy to single and Parent last. This time, I got this error
Error Message: javax.servlet.ServletException: java.lang.NoSuchMethodError: org/apache/commons/collections/CollectionUtils.isNotEmpty(Ljava/util/Collection;)Z
Wew… What an improvement.
UPDATE:
I accidentally stumbled at clear websphere caches and it solved my entire problem. After javassist is updated, /profiles/profile_name/bin/osgiCfgInit.sh
and /bin/clearClassCache.sh
should be executed.
Christian Beikov said:
Thank you for this, I used the following procedure with WAS 8.0.0.1.
The javassist.jar in WAS_HOME/plugins has to be replaced by the jar from: http://search.maven.org/remotecontent?filepath=org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar
Keep the old one as backup.
Invoke WAS_HOME/profiles/PROFILE_NAME/bin/osgiCfgInit.sh and then WAS_HOME/profiles/PROFILE_NAME/bin/clearClassCache.sh or the *.bat files on windows machines.
Yaser said:
Hi Beikov,
I was looking where to replace this javassist.jar. Your comment really helped. Many thanks
Yaser said:
@Christain n @Ramirez
Instead of replacing the hjar in the environment, ew can have a shared library and associate our application to pick the jar from that and it worked for me. Steps have been mentioned below:
Create a shared library in WAS admin console:
1. Click Environment > Shared libraries in the console navigation tree.
2. Select a shared library scope.
a. Select a cell, node which is same as application scope.
3. Click New.
4. Configure the shared library.
a. On the shared library settings page, specify the name, class path, and any other variables for the library file that are needed.
To have only one instance of a version of a class shared among applications or modules, make the shared library an isolated shared library. Select Use an isolated class loader for this shared library. Using an isolated shared library can reduce the memory footprint when a large number of applications share the library.
5. Click Apply and Save.
Associating shared libraries with application:
1. Click Applications > Application Types > WebSphere enterprise applications > application_name > Shared library references in the console navigation tree to access the Shared library references page.
2. On the Shared library references page, select an application in the checkbox you want to associate a shared library.
3. Click Reference shared libraries.
4. On the Shared library mapping page, select one or more shared libraries that the application use in the Available list, click >> to add them to the Selected list, and click OK.
5. On the Shared library references page, click OK.
6. Save the changes to the configuration and restart the server.
Lucas A. Manfrim said:
Totally right!
We are migrating a huge financial app from our client (huge japanese automotive industry) from WAS 6.1 to WAS 8.5.5 and we faced this problem, solved easily with the creation of a shared library from the javassist 3.18 jar and setting the “Use an isolated class loader for this shared library” option. Thank you man! Saved us tons of hours.