我正在尝试使用 java 8 jre (服务器地址:192.168.10.3)对我的 tomcat 9 进行 jconsole 远程监控。在 tomcat9w 中我有这个 java 选项:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=5000
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.local.only=false
-Djava.rmi.server.hostname=192.168.10.3
Run Code Online (Sandbox Code Playgroud)
防火墙已关闭。
带 -debug 的 Jconsole 向我展示了这一点:
java.lang.SecurityException: Expecting a sun.rmi.server.UnicastRef2 remote reference in stub!
at java.management.rmi/javax.management.remote.rmi.RMIConnector.checkStub(RMIConnector.java:1787)
at java.management.rmi/javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:310)
at jdk.jconsole/sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:355)
at jdk.jconsole/sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
at jdk.jconsole/sun.tools.jconsole.VMPanel$2.run(VMPanel.java:296)
java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy8.getTotalMemorySize(Unknown Source)
at jdk.jconsole/sun.tools.jconsole.SummaryTab.formatSummary(SummaryTab.java:261)
at jdk.jconsole/sun.tools.jconsole.SummaryTab$1.doInBackground(SummaryTab.java:87)
at jdk.jconsole/sun.tools.jconsole.SummaryTab$1.doInBackground(SummaryTab.java:85)
at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: javax.management.AttributeNotFoundException: No such attribute: TotalMemorySize
at com.sun.jmx.mbeanserver.PerInterface.getAttribute(Unknown Source)
at com.sun.jmx.mbeanserver.MBeanSupport.getAttribute(Unknown Source)
at …Run Code Online (Sandbox Code Playgroud)