3 Replies Latest reply on May 4, 2007 12:42 PM by argonryan

    JMX URLs

    argonryan

      I've created an MBean on a JBoss server with all default settings and it is running fine. I can see it on the jmx-console and as well as view it in the JConsole application under 'local'. How do I determine the JMX URL to use to remotely invoke the MBean?

      I am trying to get it to work with Hyperic eventually, which uses RMI to invoke remote MBeans.

      My MBean is called:
      diagnostics.shs:service=ADCStatusService

      I've tried the both of the following in JConsole (under remote), and it failed to work:
      service:jmx:rmi:///jndi/rmi://localhost:1099/jndi/diagnostics.shs:service=ADCStatusService
      service:jmx:rmi:///jndi/rmi://localhost:1098/jndi/diagnostics.shs:service=ADCStatusService

      Is my URL malformed? Defaults of my current configuration is: 1099 for the NamingService port and 1098 is the RMI port. Which should I be using?

      Below lists some of the JAVA_OPTS I added to the JBoss run.conf file.

      # Enable the jconsole agent locally
      JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"

      # Enable the jconsole agent locally with integration of the jboss MBeans
      JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
      JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
      JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"

      JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
      JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"



      Any help would be greatly appreciated.
      Thanks

        • 1. Re: JMX URLs
          dimitris

          I"m not sure exactly how is this supposed to work, but what does the jndi have to do with it?

          • 2. Re: JMX URLs
            argonryan

            The following seems to work fine. Do you know how I compose JMX RMI url equivalent to access this object?

            [x@xxxx bin]$ ./twiddle.sh -s myhost:1099 get diagnostics.shs:service=ADCStatusService DummyCounter
            DummyCounter=0

            • 3. Re: JMX URLs
              argonryan

              I figured it out. I needed to also add the following property to the run.conf:
              JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=3099"

              and then use the URL:
              service:jmx:rmi:///jndi/rmi://myhost:3099/jmxrmi