[jboss-user] [Installation, Configuration & DEPLOYMENT] - Classloading problem (sar within ear)

lucdew do-not-reply at jboss.com
Mon Aug 6 03:52:20 EDT 2007


Hi,

i have experienced some issues with classloading in Jboss.

Actually, here's how my ear is packaged:

myapp.ear:
---->init.sar
---->mylib.jar

In my sar package, i need to load a resource which is packaged in mylib.jar

If i declare a loader repository the resource can not been seen.

I added in the init.sar 's manifest.mf file a dependency on mylib.jar by declaring
a class-path entry.

I declared the java modules in the application.xml like this:

   	<module>
  | 		<java>mylib.jar</java>
  | 	</module>
  
and in my jboss-app.xml:

  <loader-repository> 
  |  com.myapp:loader=testapp
  |    </loader-repository>
  |   <module>
  |     <service>init.sar</service>
  |   </module>
  
  
I even tried the different options:

  <loader-repository> 
  |  com.myapp:loader=testapp
  | 	 <loader-repository-config> 
  |      java2ParentDelegation=false 
  |      </loader-repository-config>
  |    </loader-repository>

and with java2ParentDelegation setting to true.

Even after reading the wiki and jboss documentation i am not sure to understand
which classloaders are created for my ear and the strategy they use to load
classes (parent delegation or not).

For me, by declaring a loader-repository for my ear it only isolates classes
and libraries of my ear from the other ear but the classloader is unified (flat).
Is this correct ?

How could i deal with this issue ?

Thanks in advance,
Luc

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071042#4071042

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071042



More information about the jboss-user mailing list