2 Replies Latest reply on Jul 29, 2010 8:34 AM by Xavier MOGHRABI

    JMX access from 3rd party tools not using "-Dcom.sun.management.jmxremote.*" JVM properties

    Eugene K Newbie



      I am trying to monitor JBoss by wlshell, jmxterm and jconsole. I know there is twiddle and jmx-console which are working out-of-box but I need to get monitoring working through wlshell. I am currently toying with jconsole. I have found that jmanage and Sentry JMX Browser can connect to JBoss not using "-Dcom.sun.management.jmxremote.*" JVM properties. I know that there is JNP implementation of a JNDI service running on 1099 Port. So when i tried to use this JMXServiceURL service:jmx:rmi:///jndi/rmi://host:1099/jmx/invoker/RMIAdaptor i have got:


      "non-JRMP server at remote endpoint".


      Then i have used this JMXServiceURL service:jmx:rmi:///jndi/jnp://host:1099/jmx/invoker/RMIAdaptor. I have got:


      "Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial".


      After that i have created jndi.properties file which include:




      Also i have googled a little and found out that all this 3rd party tools use some of the JBoss libraries. But different libraries were mentioned. So i have added them all:

      jboss-jmx.jar, jboss-management.jar, jboss-system.jar, jbossall-client.jar, jnp-client.jar


      Now I am getting in jconsole:


      ...failed to connect: java.lang.ClassCastException: $Proxy0 cannot be cast to javax.management.remote.rmi.RMIServer


      Could you please help me to resolve my issue? Maybe I missed something or misunderstood JMX remoting through RMI connectors and JNP implementation of the JNDI service. Then could you please clear these things up.