1 Reply Latest reply: Feb 18, 2011 7:32 AM by Ales Justin RSS

I want ALL Classloaders to delegate downstream to my jms interfaces (jms.jar)

Ted Hulick Newbie

Class loading issue....

 

 

I have a jms.jar that is set in the sun.misc.AppClassLoader (base loader)....

 

The BaseClassLoader seems to pick up any jars in the sun base loader even though it does declare it as a parent...

 

I want ALL classloaders to delegate downward and pickup classes for the jms.jar in the standard base class loader...

 

It appears that the JBoss loaders have a "self-first" mentality in that if they find a class in their loader via .jar/etc. then

then they DO NOT delegate downstream - they load their own class...this creates problems with some instrumentation

we have.

 

So - I want MY jms.jar set in the base sun class loader (i.e. Boot->Ext->Base) to get picked up by all JBoss class loaders

 

How do I do this or make it happen?

  • 1. I want ALL Classloaders to delegate downstream to my jms interfaces (jms.jar)
    Ales Justin Master

    I see a bit of contradiction here or I don't understand the question.

     

    (1) The BaseClassLoader seems to pick up any jars in the sun base loader even though it does declare it as a parent...

    (2) I want ALL classloaders to delegate downward and pickup classes for the jms.jar in the standard base class loader...

     

    Isn't (1) saying what (2) needs?

     

    BaseClassLoader by default delegates to its ClassLoaderDomain which then delegates to parent,

    either this parent being parent ClassLoaderDomain or parent CL (e.g. bootstrap CL).

     

    It's the ClassLoadingMetaData that controls this behavior.

    e.g. for .war we change the delegation to parent-first=false, as per the servlet/war spec

     

    If we're talking non-war deployment, this should then already work ootb.

     

    A bit more info on MC' CL:

    * http://java.dzone.com/articles/jboss-microcontainer-classloading