set port attributes for both rmiRegistryPortPlatform and rmiServerPortPlatform port in the listener
e.g.
<Listener...
rmiRegistryPortPlatform="9009" rmiServerPortPlatform="9010" />
set the perms :
find /config/security.policy or config/jmxremote.access
insert both roles:
monitorRole readonly
controlRole readwrite
open both ports thru firewall
http://stackoverflow.com/questions/5045294/visualvm-through-firewalls-rmi-troubleshooting
HTH
Martin-
> To: users_at_glassfish.java.net
> From: satadru.roy_at_bchydro.com
> Subject: GF 2.1 - JMX through firewall
> Date: Thu, 17 Oct 2013 23:47:43 +0000
>
> This one is about Glassfish 2.1.x and JMX connectivity through
> firewall. Basically, we’re struggling with the random port allocation
> for the RMIServer and a client like VisualVM fails to connect through a
> firewall, even after setting
> -Dcom.sun.aas.jconsole.<instancename>.cbport = <port>, as documented
> here :
> https://blogs.oracle.com/tronds/entry/glassfish_and_jmx_through_a
>
> I was looking around in the codebase and found that in the JSR 160
> connector, the JmxConnectorServerDriver expects the JMX service url to
> be of the form "service:jmx:rmi://localhost:" +
> port1 + "/jndi/rmi://localhost:" + port2 + "/jmxrmi" where port1
> is the RMIserver port and port2 is the JMXConnector RMIRegistry port?
>
> Does this mean VisualVM has to pass in a JMX service URL of this form?