简体   繁体   中英

How to reconnect jconsole on connection lost

I am doing load test for my project, when i tried to use jconsole to monitor when the server is restarted connection is getting lost is there any solution for this?

Thanks

jconsole connects to a process, when the server is restarted it gets a new process id, and jconsole did not know of the new process that is created. There is no other but you have to connect it yourself.

Jconsole is connected to a process (jvm). When your server is stop, the process doesn't exist anymore and so the jconsole connection is lost. And so you have to connect jconsole to the new process created when you server is starting.

is there any solution for this?

One way to ease the pain is to use a JMX URL instead of a process ID. The JMX URL never changes on restart so while you have to reconnect anyway, at least the process is less painful.

URLs are of the format service:jmx:rmi:///jndi/rmi://hostName:portNum/jmxrmi . Not sure what your server is, but here's how to enable it on tomcat .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM