Jconsole error when establishing jrmp connection with nested exception: java.io.EOFException

I am trying to control a remote process using jconsole and that was the command I used

jconsole -debug localhost:4080 

And this is the stack trace I get

 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) 

It can connect successfully if I put the process pid in jconsole.

+7
source share
1 answer

We must configure tomcat to allow a remote process to connect to it for monitoring.

Essentially

 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" 

This will tell tomcat that it will monitor from (say) jconsole through port 7091 remotely.

Then launched jconsole using

 jconsole localhost:7091 

Now jconsole successfully connects.

+8
source

All Articles