You Know You’re In Trouble When…

A question I was asked today reminded me of one from my past. When a key developer asks a question showing a lack of basic understanding of a tool you just know you are in for trouble. These two are my favorites…

A key C++ developer, who had single handedly authored a large data crunching system in production asked “So, what does the virtual keyword do?”  Yup, sure enough we had started seeing rampant resource leaks… Not a virtual destructor in sight and lots of inheritance and polymorphism….

Today, a developer responsible for a RESTful service doing database CRUD, with a boat load of big reads said: “Per my understanding, every interaction with a DB has to be within the scope of a transaction…” Ruh-roh, Raggy!  So, have they been putting everything, including all the presumably intensive read only queries of static data into transactions?  I’ll find out I guess.

JBoss EAP 6.4 w/ VisualVM 1.3.8

What Didn’t Work

I was trying to chase down a performance issue in a RESTful service.  It looked like a concurrency bottleneck so I fired up VisualVM and attached it to the container… fail. Turns out JBoss doesn’t play that way.  If you search the internet for how to connect to the the JMX port of JBoss you’ll find a graveyard of old posts each specific to a select range of JBoss versions, and then further divided between Linux and Windows (I needed Windows, the road less travelled).

What Eventually Did Work

I found a github project covering JBoss 7.1  and “jvisualvm” – and with some tweaking – got it to work on JBoss 6.4 and the current VisualVM.  My work is on github.

Basically you need to add various jars from JBoss into VisualVM’s CLASSPATH and then you can “Add JMX Connection…” of the following form:


Where the hostname is the JBoss server’s host and the port is the server’s admin port. So in my case, for a standalone server on my laptop, the connection string was service:jmx:remoting-jmx://localhost:9999 and you need to provide credentials and turn off SSL.