0

我正在尝试使用 JConsole 远程连接到服务器以监视和使用在那里注册的 MBean。

我可以在服务器上进行 VNC 并使用“localhost:8050”在本地运行 JConsole,但是任何通过 IP 地址或主机名远程连接的尝试都会在 NullPointerException 中失败。

java.lang.NullPointerException

在 javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:281)

在 javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:227)

在 sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:334)

在 sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:296)

在 sun.tools.jconsole.VMPanel$2.run(VMPanel.java:280)

我已经阅读了这里和许多其他网站上的其他优秀问答。我试过用 iptables 打开端口,编辑主机文件。ssl 和身份验证被禁用,local.only 被禁用。我已经禁用了代理并尝试了 JMXServiceURL,但无济于事。

为什么我能够运行 JConsole 并在本地连接而不是远程连接?

我什至有第二台服务器,运行 win2008 和 tomcat,完美运行!

有任何想法吗?

谢谢!马丁

4

1 回答 1

1
JAVA_OPTS="-Dcom.sun.management.jmxremote \
    -Dcom.sun.management.jmxremote.port=<port no> \
    -Dcom.sun.management.jmxremote.ssl=false \
    -Dcom.sun.management.jmxremote.authenticate=false \
    -Dcom.sun.management.jmxremote.local.only=false \
    -Djava.rmi.server.hostname=<server ip>"

尝试在您的应用程序服务器上使用此设置。它在Tomcat上对我有用。

于 2011-03-31T10:44:58.177 回答