Skip to main content

[solved] Cannot connect to MBeanServer within Glassfish from a remote host

No replies
najmi
Offline
Joined: 2003-06-17

I have a webapp running within Glassfish 3.1.2 on a host with IP address 10.0.0.2.

I can connect to that JVM via jvisualvm using a JMX Connection from the local server:

service:jmx:rmi://10.0.0.2:8686/jndi/rmi://10.0.0.2:8686/jmxrmi

However if I try to create a JMX Connection within jvisualvm running on another host in the same network I get "Cannot connect to ..." error message dialog.

No authentication credentials were needed for either case.

With much help from Tomas Hurka (thanks!) I was able to get the remote connection to work by editing the ~/glassfish-3.1.2/glassfish/domains/domain1/config/domain.xml and adding the following system property line just before each occurance of :

  <jvm-options>-Djava.rmi.server.hostname=10.0.0.2</jvm-options>

This sort of explains why above is needed as an RMI limitation though I do not quite grok it. Oh well.

http://forum.springsource.org/showthread.php?64670-Why-do-I-need-to-defi...

My problem is solved but I am summarizing it here for posterity :-)

Thank again Tomas for your terrific help!