java JMX 连接失败并显示“握手失败...预期的 JDWP-Handshake”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41274317/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JMX connection fails with "handshake failed...expected JDWP-Handshake"
提问by crockpotveggies
I'm trying to connect VisualVM to a remote JMX. IntelliJ can connect without hassle, but VisualVM fails with the following in log output:
我正在尝试将 VisualVM 连接到远程 JMX。IntelliJ 可以轻松连接,但 VisualVM 失败并在日志输出中显示以下内容:
Listening for transport dt_socket at address: 5005
Debugger failed to attach: recv failed during handshake: Resource temporarily unavailable
Debugger failed to attach: handshake failed - received >< - expected >JDWP-Handshake<
Here are the JVM properties I'm passing at runtime:
这是我在运行时传递的 JVM 属性:
-XX:MaxPermSize=50g -XX:+HeapDumpOnOutOfMemoryError -Xmx50g -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=100.100.100.100 -Dcom.sun.management.jmxremote.port=5006 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
Using VisualVM 1.3.9. Not sure why it fails why IntelliJ succeeds. I've tried disabling SSL auth, etc.
使用 VisualVM 1.3.9。不知道为什么它会失败,为什么 IntelliJ 会成功。我试过禁用 SSL 身份验证等。
回答by Nicholas
The socket listening on 5005 is not a JMX listener, it's the java debug wire protocollistener. As such, VisualVM will not be able to connect to that port, and that's why you're seeing a handshake failure.
侦听 5005 的套接字不是 JMX 侦听器,而是Java 调试线协议侦听器。因此,VisualVM 将无法连接到该端口,这就是您看到握手失败的原因。