@chuck and @martin You both helped me. Turns out that I could move all
weblogic classes in WEB-INF/lib and out of the System classloader. But
moving just weblogic.jar did not do the trick. I needed to package the
following jars from the BEA distribution into the Webapp:
weblogic.jar
wljmxclient.jar
wlclient.jar

Thanks for your help!

Pankaj


Pankaj Tandon wrote:
> 
> Hi all,
> I am writing a webapp that uses JMX to manage weblogic and websphere
> servers and hosting it on Tomcat 6.0.18. The app also uses Jython to
> manipulate MBeans within the app servers.
> 
> Here's the issue that I'm facing:
> To get a JMX connection using JMXConnectionFactory using below:
> JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h);
> I have to rely on classes in weblogic.jar
> That is because the implementation of JMXConnector is in weblogic.jar.
> However, the interface/abstract class for JMXConnectionFactory lives in
> rt.jar that comes with JDK1.5 or JDK1.6
> 
> Because rt.jar is (probably) used by the bootstrap classloader, I HAVE to
> include weblogic.jar in the CATALINA_HOME/common/lib directory. If I do
> so, I can get the JMX part of the solution to work because both, rt.jar
> and weblogic.jar are loaded by the same (system) classloader. 
> 
> But then my Jython classes do not work because jython.jar is tucked away
> in the webapp's WEB-INF/lib dir of the webapp and my Jython solution needs
> classes from weblogic.jar which is loaded by the system classloader and
> hence in a different namespace.
> I tried placing jython.jar in common/lib too, but that did not work
> because Jython needs classes from my webapp and I go down a slippery slope
> of chasing classes across classlaoders.
> 
> So the ideal solution would be to get weblogic.jar loaded from the webapp
> classloader. And not place anything in the CATALINA_HOME/common/lib
> directory.
> 
> How can I place weblogic.jar in the webapp classlaoder and have my JMX
> solution work, given that javax.management.remote.JMXConnectorFactory
> resides in rt.jar which is in the System classpath?
> 
> Any pointers will be appreciated!
> 
> Thanks a lot!
> 
> Pankaj
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-JMX-with-Tomcat%3A-classloading-issues-tp24055767p24058867.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to