<< and the oscar goes to... | Home | crypt() function & windows >>

JBoss UCL classloader hell...

Classpath problems with JBoss?

Most advance jboss developers know of the magic of the java2ParentDelegation=false setting, because sooner or later every jboss user is affected by the bad, bad JBoss UCL classloader hell...

Me for example encountered the following issue: An application of mine required a 3.x version of commons HTTPClient while JBoss 4.0.5 has (for whatever reasons) a 2.x version of httpclient in its classpath. This naturally leads to errors like the following:

This is because JBoss has already loaded the affected class from its server classpath and therefore did load the class from the newer http client library that was packaged with my application.

So I changed the java2ParentDelegation setting in my jboss-service.xml to false for my applications .sar file but still it was not working :-(. I then realized that the JAR that was depending on httpclient was missing the httpclient.jar entry in its manifest. I added it and everything was working then...




Add a comment Send a TrackBack