2 Replies Latest reply on Nov 5, 2010 8:16 PM by obrienmi8

    JMX ports and Glassfish


      I'm having a hell of a time getting remote JMX working for glassfish (primarily 2.1.1, though possibly 3.x in the near future).

      There are no firewall issues on my test environment but the problem is we need to specify ports for it to use in production.

      I have tried:
      setting jvm option: -Dcom.sun.aas.jconsole.server.cbport=xxxx
      creating a custom JMXConnectorServer for the web application (should this work, not entirely clear on that ...)

      Anyways it's quite frustrating. I'm not hugely experienced with JMX but it seems really ridiculously difficult to get working :( I can connect to JMX through jconsole on the local machine without issue, however I simply cannot get a remote connection to work using a JMXServiceURL. Not sure if I am missing some fundamental step or what ... if anyone could provide me with some information it would be most appreciated.

      I'll mention that I've been able to get remote JMX going before from a standard java application, it's just remote access in glassfish that is being a bitch.

      I have tried the following URL types:

      ... and pretty much every variation of the above w/ swapping which port is used where.

      Edited by: ratdump on Sep 14, 2010 3:09 PM
        • 1. Re: JMX ports and Glassfish
          Hi, the service url is different between the 2.1 and 3.0 versions of GlassFish and not fully intuitive.
          I recently added JMX support for both GlassFish servers for EclipseLink 2.1 in Eclipse.org bug# 316512


          The JMXService url for GlassFish V3 is a really odd non-JMX spec - this is the 3.0.1 version embedded in NetBeans 6.9

          instead of an expected


          The only difference between yours, is that the first one has two //, yours has /// - and try to remove the jndi/rmi: in the middle and add a jndi/ before the end jmxrmi - it should then work on GlassFish 2. Your 2nd entry should work on GlassFish 3

          thank you
          • 2. Re: JMX ports and Glassfish
            Just saw your edit - stating your local works but your remote fails.
            I started up my GlassFish V 3.0.1 server on my 64-bit machine with 2 network interfaces.
            With the following Service URL I could connect via JMX both locally and remotely on my private subnet from another 32-bit server (all running the SUN 1.6 JVM)


            Actually, I forgot, GlassFish V3 lets you know the JMX Service URL to use - check your server logs for the following

            9;_ThreadName=Thread-18;|JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://xps435:8686/jndi/rmi://xps435:8686/jmxrmi|#]

            My results:
            enable the port via firewall popup - if required
            log from local JConsole connect
            0;_ThreadName=RMI TCP Connection(4)-**;|BootAMXListener: connection made for service:jmx:rmi://xps435:8686/jndi/rmi://xps435:8686/jmxrmi, booting AMX MBeans|#]
            log from remote JConsole connect
            1;_ThreadName=RMI TCP Connection(9)-**;|BootAMXListener: connection made for service:jmx:rmi://xps435:8686/jndi/rmi://xps435:8686/jmxrmi, booting AMX MBeans|#]

            I have not tested remote connection from a different server on 2.1 but I have tested a remote url locally.
            Is it possible to test on a 3.0.x server?

            thank you