[jboss-user] [JBoss Microcontainer] New message: "Classloaders: How to hide classes from the DefaultDomain?"

Gilles Compienne do-not-reply at jboss.com
Wed Feb 10 13:25:22 EST 2010


User development,

A new message was posted in the thread "Classloaders: How to hide classes from the DefaultDomain?":

http://community.jboss.org/message/525540#525540

Author  : Gilles Compienne
Profile : http://community.jboss.org/people/gcompienne

Message:
--------------------------------------------------------------
I have a jar that uses Infinispan (JBossCache's replacement) and I want to load it with the Infinispan libraries on JBoss AS 5.1.
 
Now my problem is that JBoss AS 5.1 uses an older version of JGroups that seems to be incompatible.
 
Also, I have seen simlar issues with other libraries where they use reflection to detect their versions. But this means that when they see the classes used by JBoss AS (via the DefaultDomain) then they sometimes mis-identify what version of a lib they are currently using.
 
So I am looking at isolating my JAR file (and its internal libraries) by specifying the classloading constraints via the jboss-classloading.xml file.
 
I am able to specify my new (separate) domain however I can't set the parent domain to be the "java" domain (i.e. java.* and nothing else).
 
I tried to set it to "" or "null" but to no avail.
 
And this means that currently everything loaded by the AS is made visible to the JAR (when ideally I want to specify what I will use from the AS and implicitely what I intend to provide myself...).
 
<classloading domain="InfinispanCacheDomain" xmlns="urn:jboss:classloading:1.0" 
              import-all="false" parent-first="false" parent-domain="null" top-level-classloader="true">
     
 <requirements>
       <package name="api.offered.by.app.using.infinispan"/>
       <package name="org.apache.log4j"/>
 </requirements>  
 <capabilities>
       <package name="app.service.impl"/>
       <!-- could perhaps even expose the API of Infinispan, for other apps to us? But TBD -->
 </capabilities>
   
</classloading>
 
Thanks for your help.
 
Gilles.

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/525540#525540




More information about the jboss-user mailing list