Cmdline-jmxclient.jar is very useful to check if jmx port of application alive.
You can download from jmxclient. and can use it below examples.
http://crawler.archive.org/cmdline-jmxclient/
When you use this command in shell, if you do not see any kinds of exception, it means successful. But, if you see a exception, it means a problem of application.
Ex1) Application have no jmx port
java -jar cmdline-jmxclient.jar - idowww.svr.google.com:11005 java.lang:type=Memory gc
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: idombr702.svr.hangame.com; nested exception is:
java.net.ConnectException: Connection refused]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:323)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at org.archive.jmx.Client.execute(Client.java:225)
at org.archive.jmx.Client.main(Client.java:154)
java.net.ConnectException: Connection refused]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:323)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at org.archive.jmx.Client.execute(Client.java:225)
at org.archive.jmx.Client.main(Client.java:154)
Ex2) Application have trouble of binding jmx port
java -jar cmdline-jmxclient.jar - idowww.svr.google.com:11005 java.lang:type=Memory gc
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxrmi
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:323)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at org.archive.jmx.Client.execute(Client.java:225)
at org.archive.jmx.Client.main(Client.java:154)
Caused by: javax.naming.NameNotFoundException: jmxrmi
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:99)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1871)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1841)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
... 3 more
Ex2) Success - no print out.
Shell>java -jar cmdline-jmxclient.jar - idombr701.svr.hangame.com:11005 java.lang:type=Memory gc
Shell>
'java core' 카테고리의 다른 글
Java Garbage Collection, Monitoring and Tuning (0) | 2009.12.09 |
---|---|
Eclipse(JVM) Crash (0) | 2009.12.09 |
JDK 7 언어적으로 특징적으로 변하는 부분. (api 제외) (0) | 2009.11.13 |
파일 copy 테스트 (nio, inputstream) 테스트 in java (0) | 2009.09.11 |
Java Memroy Model (0) | 2009.08.06 |