Проблема с запуском jstatd

Я пытаюсь подключить JVisualVM к jstatd. Однако на моем удаленном сервере у меня возникают проблемы с запуском jstatd.

#  netstat -nlp | grep rmiregistry
tcp        0      0 0.0.0.0:1098                0.0.0.0:*                   LISTEN      7320/rmiregistry
tcp        0      0 0.0.0.0:34872               0.0.0.0:*                   LISTEN      7320/rmiregistry

Ошибка

# ./jstatd -J-Djava.security.policy=jstatd.all.policy -p 1098
Could not bind //:1098/JStatRemoteHost to RMI Registry
java.rmi.UnexpectedException: undeclared checked exception; nested exception is:
        java.lang.ClassNotFoundException: sun.jvmstat.monitor.remote.RemoteHost not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
        at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
        at java.rmi.Naming.rebind(Naming.java:177)
        at sun.tools.jstatd.Jstatd.bind(Jstatd.java:57)
        at sun.tools.jstatd.Jstatd.main(Jstatd.java:143)
Caused by: java.lang.ClassNotFoundException: sun.jvmstat.monitor.remote.RemoteHost not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)
        ... 4 more

person DarVar    schedule 23.09.2013    source источник


Ответы (1)


Вы используете неправильный JDK. Этот sun.jvmstat.monitor.remote.RemoteHost not found in gnu.gcj.runtime.SystemClassLoader показывает, что вы используете GCJ для запуска Jstatd. Пожалуйста, используйте OpenJDK или Oracle JDK.

person Tomas Hurka    schedule 27.09.2013