[JAVA] When JConsole cannot connect locally

I haven't found any Japanese articles that can shoot through the information I want to know, so I will write them down.

** Articles that helped solve the problem ** https://community.oracle.com/thread/1177644

phenomenon

I had to use jconsole, which monitors Java processes, so when I went to access the resident Java process locally, I couldn't access only one of the four processes. 無題.png Why do you fail because it's local? Did the connection not succeed?

approach

If you give the target * jar * file an option to monitor it, you can now monitor it with Jconsole. Example) Execute with the option to monitor with JMX at the command prompt.

command(win10)


java -Dcom.sun.management.jmxremote -jar The desired jar.jar

I didn't usually think about it, but to make it a monitoring target, I should add an option. On the contrary, other successful processes would have bat-assembled so that someone would add an option at startup.

What is JMX? (Extra edition)

Reference source: Official Oracle document

"Java Management Extensions (JMX) is a specification for monitoring and managing Java applications."

JMX Guide ↓ ~~ I thought I'd put it together, but it was annoying ~~ https://docs.oracle.com/javase/jp/8/docs/technotes/guides/management/agent.html

Recommended Posts

When JConsole cannot connect locally
Measures when model cannot be created