Tuesday, May 13, 2014

Q&A for Activemq JMX connection issue (permission exception) using AnyConnect VPN

After connected to VPN using Cisco Any connect client pgm, I found Java program will have connection issue when accessing the JMX service hosted by Activemq on the same machine(localhost). Permission exception is thrown when trying to connect to the JMX rmi service. The IP address bound to the JMX is an IP address assigned by VPN.




I found the root cause is the JMX stub can not be reached when the service is bound to the IP address assigned by VPN. This IP is behind the NAT and permission exception is thrown when trying to be reached. The workaround is to force bind the JMX server to the public/accessible IP address. When running services locally, adding JVM option ”-Djava.rmi.server.hostname=127.0.0.1” to the startup scripts will solve the issue.

No comments: