【问题标题】:jconsole error during jrmp connection establishment nested exception is : java.io.EOFExceptionjrmp 连接建立期间的 jconsole 错误嵌套异常是:java.io.EOFException
【发布时间】:2012-11-24 08:09:44
【问题描述】:

我正在尝试使用 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,它就能成功附加。

【问题讨论】:

    标签: exception process jconsole


    【解决方案1】:

    我们必须配置 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 连接成功。

    【讨论】:

    • 嗨,我也遇到了同样的异常。我应该在我的 tomcat 中配置哪个文件。谢谢
    • 您必须将这些添加到 catalina.sh
    • 我在端口 7091 上成功连接,但我的 webapp 在端口 8080 上运行。我是监控新手,如果我在端口上监控,我是否仍然看到我的 webapp 对服务器的内存影响7091?
    • @KasparTr,是的,你会的,所有事件都被中继到调试端口。这就是您能够连接和监控应用指标的方式。
    猜你喜欢
    • 1970-01-01
    • 2021-04-26
    • 1970-01-01
    • 1970-01-01
    • 2012-12-04
    • 1970-01-01
    • 2011-11-26
    • 2020-02-04
    • 1970-01-01
    相关资源
    最近更新 更多