JBoss Community

Re: More on BaseClassLoader conflict with Instrumentation....

created by Ales Justin in JBoss Microcontainer - View the full discussion
* The classes in the BaseClassLoader pick up the classes from the sun Class Loader just fine - evidently, the BaseClassLoader IS delegating to the

sun base Class Loader EVEN THOUGH it shows that it's parent is NOT the base loader (which I normally see), but instead the parent being

null indicating a native or boot loader.

System Classloader

 

* The problem comes when code in the sun loader is called by the code in the BaseClassLoader and the javax.jms.Session interface seems to be loaded into the BaseClassLoader from jms.jar in the WAR (self first? as it DID NOT delegate down to the sun Class Loader) and all comes

apart when a class impl for javax.jms.Session created in the BaseClassLoader is then cast to javax.jms.Session in the sun Class Loader and

because they were loaded in 2 different class loaders they are not considered the same class and we get a Class Cast Exception.

Why exactly do you need that jms.jar in .war?

 

Self first is per the spec for web/.war deployments.

***** I want to either at runtime set the Classpath for the BaseClassLoader to my instrumentation classes which would resolve this issue OR

force ALL class loaders to delegate downstream to the jms.jar that I loaded in the sun AppClassLoader....

Add jboss-classloading.xml with parent-first=true attribute.

 

If you want that the rest of classes (non jms.jar) are still looked parent-first=false, you need a bit more work.

The new jboss-classloading-domain.xml in AS6 helps here, but unfortunately it has a few bugs, which are already fixed,

and as such will be part of next AS6.1 release.

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community