프로그래밍 방식으로 새 Java 프로세스를 시작하고 동적으로 JMX 포트를 설정해야합니다. 그래서 대신하고 난 다음프로그래밍 방식으로 원격 jmx 모니터링을 활성화 할 수 있습니까?
System.setProperty("java.rmi.server.hostname", "127.0.0.1");
System.setProperty("com.sun.management.jmxremote", "true");
System.setProperty("com.sun.management.jmxremote.authenticate", "false");
System.setProperty("com.sun.management.jmxremote.ssl", "false");
System.setProperty("com.sun.management.jmxremote.port", "9995" );
을하고 싶지만 그것이 작동하지 않는이
-Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.port=9995 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
. 왜 그런가?
IMHO 불가능합니다. – SMA
이 [답변] (http://stackoverflow.com/questions/7276881/how-to-set-jmx-remote-port-system-environment-parameters-through-java-code-for-r)을 참조하십시오. 이것이 목표라면 [Java Attach API] (http://docs.oracle.com/javase/7/docs/technotes/guides/attach/index.html)를 사용하여 원격으로 JVM을 모니터 할 수 있습니다. – vsnyc