首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jconsole远程连接丢失:是否重新连接?

Jconsole远程连接丢失:是否重新连接?
EN

Stack Overflow用户
提问于 2020-09-27 23:47:31
回答 1查看 1.3K关注 0票数 2

我正在尝试用java 8 jre对我的tomcat9进行jconsole远程监控(服务器地址: 192.168.10.3)。在tomcat9w中,我有以下java选项:

代码语言:javascript
复制
-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

防火墙已关闭。

使用-debug的Jconsole向我展示了以下内容:

代码语言:javascript
复制
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 javax.management.StandardMBean.getAttribute(Unknown Source)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(Unknown Source)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at sun.rmi.transport.Transport$1.run(Unknown Source)
    at sun.rmi.transport.Transport$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    at java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303)
    at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279)
    at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)
    at jdk.remoteref/jdk.jmx.remote.internal.rmi.PRef.invoke(Unknown Source)
    at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl_Stub.getAttribute(Unknown Source)
    at java.management.rmi/javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getAttribute(RMIConnector.java:904)
    at jdk.jconsole/sun.tools.jconsole.ProxyClient$SnapshotInvocationHandler.getAttribute(ProxyClient.java:1011)
    at jdk.jconsole/sun.tools.jconsole.ProxyClient$SnapshotInvocationHandler.invoke(ProxyClient.java:984)
    at jdk.proxy1/com.sun.proxy.jdk.proxy1.$Proxy1.getAttribute(Unknown Source)
    at java.management/com.sun.jmx.mbeanserver.MXBeanProxy$GetHandler.invoke(MXBeanProxy.java:122)
    at java.management/com.sun.jmx.mbeanserver.MXBeanProxy.invoke(MXBeanProxy.java:167)
    at java.management/javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:258)
    ... 10 more

所以我不知道我的tomcat和java出了什么问题。我阅读了tomcat文档,但没有找到任何可以帮助我解决这个问题的东西。

EN

回答 1

Stack Overflow用户

发布于 2020-10-08 16:19:46

在我的例子中,我尝试在openjdk-1.11上的虚拟机上运行openjdk-1.14中的JConsole,得到相同的错误。

使用不同的JDK做到了这一点。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64090365

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档