jvisualvm - automatically (JMX) reconnect to application?
Asked Answered
D

3

14

Is there any way to reconnect disconnected JMX connection in jvisualvm? When monitored JMX enabled application restarts, I have to restart jvisualvm to reconnect it. Am I missing something?

Here are my jvisualvm details:

Version: 1.6.0_22 (Build 100326); platform 091221-4fc006d17cb1
System: Linux (2.6.35-23-generic) , amd64 64bit Java: 1.6.0_22; Java HotSpot(TM) 64-Bit Server VM (17.1-b03, mixed mode)

Deutschland answered 13/1, 2011 at 10:13 Comment(1)
I agree, VisualVM is very very useful once you get JMX remote monitoring configured and working. Most people use VisualVM over commercial tools last I checked the statistics too.Golfer
H
5

there is JIRA for that feature: https://java.net/jira/browse/VISUALVM-120

Highflier answered 23/9, 2013 at 12:6 Comment(2)
As I updated my answer to say, this looks like the closest analog in the GitHub issues - github.com/oracle/visualvm/issues/45Chetnik
As per that issue, it seems to be implemented in VisualVM 2.0Wham
C
2

At least in the current version (1.8.0_45 (Build 1380-140910)), if you check the "Save security credentials" checkbox in the "Add JMX Connection..." dialog, it will attempt to reconnect to the remote server when visualvm is next started. So, if you get disconnected, you can quit out of visualvm and relaunch it in order to reconnect. I know that's not quite what you were asking for, but at least it works. The fact that the feature you were hoping for still hasn't been implemented over 10 years after it was first requested is pretty sad. My guess is that they're trying to get people to buy Mission Control instead.

The original issue for this at java.net no longer exists, but this appears to be the equivalent on GitHub. Go give it a thumbs up if you care about it being completed/fixed.

Chetnik answered 13/7, 2015 at 17:55 Comment(4)
Best solution so far and really sad it is not implemented during such a log period of time :/Brandybrandyn
@Brandybrandyn yeah... and now it's over 8 years since the feature was requested. :(Chetnik
I wouldn't mind if there was a big ugly splash whenever I start VisualVM that reads: "What are you nuts? Use Mission Control!"Golfer
@JonathanNeufeld ha ha :)Chetnik
M
0

I don't know that there is a way to do that. As a workaround, you could create a DOS batch file (or a bash script on Linux) that monitors the JMX port and if the port disappears it can kill jvisualvm and restart it.

Magnetics answered 21/3, 2011 at 20:22 Comment(1)
Yes, it can be done this way, but it's very ugly method. That's not what I'm looking for.Pneumectomy

© 2022 - 2024 — McMap. All rights reserved.