amr*_*rk7 7 exception process jconsole
我正在尝试使用jconsole监视远程进程,这是我使用的命令
jconsole -debug localhost:4080
Run Code Online (Sandbox Code Playgroud)
这是我得到的堆栈跟踪
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)
Run Code Online (Sandbox Code Playgroud)
如果我将进程的pid提供给jconsole,它就能成功附加.
我们必须配置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"
Run Code Online (Sandbox Code Playgroud)
这将告诉tomcat它将从(例如)jconsole通过端口7091远程监控.
然后启动jconsole
jconsole localhost:7091
Run Code Online (Sandbox Code Playgroud)
现在jconsole成功连接.