1
votes

I'm stumped. On my old Mac, Jconsole couldn't connect to local JVMs. I thought I had done something to mess up system configuration. Then I got a new Mac. The first thing I did was download a jdk, install it and check to see if jconsole could connect. It could.

Then I pulled over users and applications from my old mac using my Time Machine backup drive except my system files. Still worked.

But I found that odd things were happening with my development environment. In eclipse, I could start my Jboss server, but eclipse never recognised that the Jboss server had started. So, I could never add or delete war files to it through eclipse.

Also, the jboss instance could not connect to my localhost PostGres database even though the ds file clearly gave localhost as the host to connect to.

I fixed these problems by giving my new Mac the hostname the old Mac had had. But now I am back to not being able to connect to my local JVMs through jconsole.

This affects not just jconsole, but jprof as well so I'd like to get it fixed.

jconsole can see the JVM processes. It just times out when I try to connect.

I also tried connecting to localhost: by writing a java class that slept for five minutes and running it with the following command line:

java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false

but I cannot connect to localhost:9010 or :9010 either. My guess would be this is some network configuration problem, but any help would be really really appreciated.

Thanks,

George

1
Since posting added -Dcom.sun.management.jmxremote.ssl=false to the run parameters.Warren
Since posting added -Dcom.sun.management.jmxremote.ssl=false to the run parameters. I can now telnet to port 9010 from a virtual windows host I have running on my Mac. Jconsole can also see the process using <myhostname>:9010 from jconsole running on the virtual host. However, jconsole times out accessing the VM information. So, jconsole knows the VM is there, but cannot do whatever it needs to get the usage information from the VM.Warren

1 Answers

3
votes

I had similar issues with timeouts. Looking at the packets being sent, it seems that jconsole was trying to connect via an external interface and being blocked by the firewall.

I added

JAVA_TOOL_OPTIONS=-Djava.rmi.server.hostname=localhost

to my environment to ensure all java processes used localhost instead of an external interface for RMI (which is what jconsole is using for connections)