10

我正在尝试使用 jconsole 监视远程进程,这是我使用的命令

jconsole -debug localhost:4080

这是我得到的堆栈跟踪

java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: 
    java.io.EOFException
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:286)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at sun.tools.jconsole.ProxyClient.checkSslConfig(ProxyClient.java:217)
    at sun.tools.jconsole.ProxyClient.<init>(ProxyClient.java:110)
    at sun.tools.jconsole.ProxyClient.getProxyClient(ProxyClient.java:463)
    at sun.tools.jconsole.JConsole$3.run(JConsole.java:510)
Caused by: java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:250)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:228)

如果我将进程的 pid 提供给 jconsole,它能够成功附加。

4

1 回答 1

8

我们必须配置 tomcat 以允许远程进程连接到它以进行监视

本质上补充说,

CATALINA_OPTS="-Djava.awt.headless=true -Xmx128M -server -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7091 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

这将告诉 tomcat 它将从(例如)jconsole 通过端口 7091 远程监控。

然后开始 jconsole

jconsole localhost:7091

现在 jconsole 连接成功。

于 2012-12-06T10:34:25.173 回答