I was a little lost and confused when I wrote a question. Here is what I learned at the same time. Typically, the Tomcat Windows service runs under the local system account. This is the main reason for all the fuss.
-Dcom.sun.management.jmxremote JVM JMX . JMX-, JVM (, ), MBeanServer : MBeanServerFactory.findMBeanServer(<specific-agent-ID-or-null>). JConsole Tomcat. : https://blogs.oracle.com/nbprofiler/entry/monitoring_java_processes_running_as.
, , -Dcom.sun.management.jmxremote.port=<port>. JMX JConsole localhost:<port>. Java :
JMXServiceURL target = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:<port>/jmxrmi");
JMXConnector connector = JMXConnectorFactory.connect(target);
connector.getMBeanServerConnection();