This sounds like a problem with the digester using Class.forName
instead of the thread context class loader. Why does the digester
need to be on the system classpath? Including the digester jar in
lib/ext is the simplest solution.
>a- force jboss to obtain the digester classes from my application
>classloader, or
With dynamic class loading nothing can be forced. Ultimately a call
to ClassLoader.findClass is being made and the code initiating this
call needs to obtain the correct class loader. It should be using the
thread context class loader. If the code is using Class.forName then
the code has to be loaded by a class loader that has visibility to every
class that is going to loaded.
>b- force my mbean to use a digester instance which is loaded by a
>classloader which is NOT a parent of my application classloader (thus
>forcing the application classloader to load the class)
Your mbean can always try to create its own class loaders, but the
simpler approach is to deploy an ear that uses scoped class loading.
Include the digester jar in the ear along with your mbean sar and then
use an ear META-INF/jboss-app.xml descriptor like:
<jboss-app>
<loader-repository>some-domain:loader=my.ear</loader-repository>
<module>
<service>my.sar</service>
</module>
</jboss-app>
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx
----- Original Message -----
From: "Jason Stiefel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Simon Sadedin" <[EMAIL PROTECTED]>; "Laine Donlan"
<[EMAIL PROTECTED]>; "Marc Stogner" <[EMAIL PROTECTED]>; "Michael
Quigley" <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 8:30 AM
Subject: [JBoss-user] Server classloader versus application classloader
(With regards to JMX)
List-
I've written an mbean which is the last mbean started by JBossMX. This
means that my application has deployed, prior to starting the mbean. My
MBean uses the jakarta digester utility to digest an xml file. The way
the digester implementation works is you create rules which dynamically
instantiate classes.
Now- starting my mbean works fine as long as my digester lib is present
in lib/ext. My problem occurs when my logging into my application, where
the digester is used by an EJB to digest another XML file. Because the
digester was loaded in the (root?) classloader, it does not have access
to the classes within my (application?) classloader, so the digest
process fails from the EJB.
My question is- how does one:
a- force jboss to obtain the digester classes from my application
classloader, or
b- force my mbean to use a digester instance which is loaded by a
classloader which is NOT a parent of my application classloader (thus
forcing the application classloader to load the class)
thanks!
jstiefel
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user