@Chuck: Yes, I did kind of munge the bootstrap and System classloaders
together. But the problem still remains. When I remove weblogic.jar from
common/lib and my code attempts to establish a JMX connection using below:
JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h);
I get the following error stack:
java.net.MalformedURLException: Unsupported protocol: t3
javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:327)
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:247)
com.fedex.ground.scm.service.ControllerServiceImpl.initConnection(ControllerServiceImpl.java:105)
com.fedex.ground.scm.service.ControllerServiceImpl.retrieveAppDataForHost(ControllerServiceImpl.java:47)
com.fedex.ground.scm.ControllerBean.setSelectedHost(ControllerBean.java:75)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.el.parser.AstValue.invoke(AstValue.java:172)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:71)
javax.faces.component.UICommand.broadcast(UICommand.java:377)
com.icesoft.faces.component.panelseries.UISeries$RowEvent.broadcast(UISeries.java:559)
com.icesoft.faces.component.panelseries.UISeries.broadcast(UISeries.java:238)
javax.faces.component.UIData.broadcast(UIData.java:849)
com.icesoft.faces.component.panelseries.UISeries.broadcast(UISeries.java:233)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:452)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:764)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:132)
com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46)
t3 is a WLS proprietary protocol so I am assuming that JMXConnectorFactory
does not even get to the weblogic.jar class to pick up the JMX classes to
recognize the weblogic protocol.
So that is the symptom. If I can get the Weblogic.jar file out of the System
classpath (and into the WEB-INF/lib), I'm pretty sure, I can get the Jython
piece to work.
@Martin: The wljmxclient.jar that you mentioned does not have the class
JMXConnector. And I'm not sure why jConsole is being used here.
Thanks!
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-tp24055767p24057930.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]