I think, therefore I blog

JConsole / JMX broken on Ubuntu

By , 11 February 2008

JConsole / JMX broken on Ubuntu

How annoying. I have just spent the last three hours trying to connect to Tomcat remotely using JConsole/JMX. It worked fine for one server, but not the other which was started with exactly the same settings. Eventually I found the problem: Ubuntu maps the hostname to in /etc/hosts by default and this breaks the JMX protocol. It seems that JMX opens a separate socket stream for data (like FTP) and needs to provide the host's network address to do this.

Actually, my problem was already documented in the FAQ:

On a side note, I also had problems with Netbeans 6.0 being dog slow on Ubuntu. It seems to have had something to do with the GTK look and feel, because I fixed it by adding --laf javax.swing.plaf.metal.MetalLookAndFeel to the startup options in ${nbhome}/etc/netbeans.conf. It runs great now.

JConsole / JMX broken on Ubuntu

About Roger Keays

JConsole / JMX broken on Ubuntu

Roger Keays is an artist, an engineer, and a student of life. Since he left Australia in 2009, he has been living as a digital nomad in over 40 different countries around the world. Roger is addicted to surfing. His other interests are music, psychology, languages, and finding good food. Click here to subscribe to his weekly blog, or stalk him on Facebook and Twitter.

Leave a Comment

Please visit https://RogerKeays.com/blog/jconsole-jmx-broken-on-ubuntu to add your comments.

Comment posted by: , 8 years ago

Hey Dave, I can't this of anything that will work using /etc/hosts, but maybe you can use a dynamic dns server (dyndns.com, no-ip.com) so that your hostname always resolves to the correct IP. Or it might just be easier to update /etc/hosts by hand when your IP changes.

Comment posted by: Dave, 8 years ago

I have the same problem as you, but I also have a dynamic IP address provided by a DHCP server.  Any idea what my /ect/hosts entry should be to get jconsole working?  Thanks!

Join 3,559 People Who Think Outside The Box

I write every Sunday about travel, psychology, technology, and all sorts of interesting stuff. It's completely free, and you can leave whenever you like. Subscribe now, and you'll be the first to get new articles each week.

Read a Good Book

“A spellbinding true story of love, passion and adventure. One can’t help but be swept away by 100% Love Guaranteed.” —Dr Tammie Matson, author of Elephant Dance.

Chat For A While

Your Vote Matters

Which animal will take over when humans go extinct?