Diagnosing JConsole/JVisualvm connection issues to JBoss EAP 7 / 6

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
    • 6

Issue

  • Diagnosing jconsole/jvisualvm connection issues to JBoss EAP 7 / 6
  • Unable to connect to JConsole or Visual VM through JMX

Resolution

How to enable DEBUG logging for JConsole or JVisualVM

Make sure running $EAP_HOME/bin/jconsole.sh or are adding the jboss-cli-client.jar to the classpath

Run with the -debug option and the logging configuration to output the debug logs as described in How to connect to JBoss EAP 6 / JBoss EAP 7 using VisualVM.

Security logging can be enabled on the EAP side to diagnose issues where the username / password is being rejected as shown in Enabling security Debug/Trace logging in JBoss EAP 6 or 7

Common Issues

java.net.MalformedURLException: Unsupported protocol: remoting-jmx

This means jconsole is not being run from $EAP_HOME/bin/jconsole.sh. $EAP_HOME/bin/jconsole.sh adds the $JAVA_HOME/lib/tools.jar and $EAP_HOME/bin/client/jboss-cli-client.jar to the jconsole classpath, without the jboss-cli-client.jar jconsole does not understand the remoting-jmx protocol.

java.net.MalformedURLException: Unsupported protocol: remoting-jmx
	at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:359)
	at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:269)
	at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:370)
	at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
	at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:294)

javax.security.sasl.SaslException: Authentication failed: the server presented no authentication mechanisms

This exception means the username / password were not valid

javax.security.sasl.SaslException: Authentication failed: the server presented no authentication mechanisms
	at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:414)
	at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:244)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
	at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
	at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
	at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
	at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:183)
	at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
	at org.xnio.nio.NioHandle.run(NioHandle.java:90)
	at org.xnio.nio.WorkerThread.run(WorkerThread.java:198)
	at ...asynchronous invocation...(Unknown Source)
	at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:293)
	at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:274)
	at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:386)
	at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:370)
	at org.jboss.remotingjmx.RemotingConnector.internalRemotingConnect(RemotingConnector.java:230)
	at org.jboss.remotingjmx.RemotingConnector.internalConnect(RemotingConnector.java:151)
	at org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:102)
	at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
	at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:370)
	at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
	at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:294)

java.net.ConnectException: Connection refused

This exception means the host / port provided in the Remote Process url is not correct or not reachable

java.net.ConnectException: Connection refused
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:715)
	at org.xnio.nio.NioXnioWorker$1.handleEvent(NioXnioWorker.java:329)
	at org.xnio.nio.NioXnioWorker$1.handleEvent(NioXnioWorker.java:325)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
	at org.xnio.nio.NioHandle.run(NioHandle.java:90)
	at org.xnio.nio.WorkerThread.run(WorkerThread.java:198)
	at ...asynchronous invocation...(Unknown Source)
	at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:293)
	at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:274)
	at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:386)
	at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:370)
	at org.jboss.remotingjmx.RemotingConnector.internalRemotingConnect(RemotingConnector.java:230)
	at org.jboss.remotingjmx.RemotingConnector.internalConnect(RemotingConnector.java:151)
	at org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:102)
	at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
	at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:370)
	at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
	at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:294)

java.io.IOException: java.io.IOException: Unknown service name

This exception means the Remote Process URL pointed to a valid host/port and it was able to connect using the username / password but the remoting endpoint running on this host/port does not provide JMX service. This typically means the JMX subsystem is configured to use the management or remoting endpoint and the client connected to the wrong one.

java.io.IOException: java.io.IOException: Unknown service name
	at org.jboss.remotingjmx.RemotingConnector.internalConnect(RemotingConnector.java:171)
	at org.jboss.remotingjmx.RemotingConnector.connect(RemotingConnector.java:102)
	at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
	at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:370)
	at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
	at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:294)
Caused by: java.io.IOException: Unknown service name
	at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:435)
	at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:46)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
	at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
	at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
	at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
	at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:183)
	at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
	at org.xnio.nio.NioHandle.run(NioHandle.java:90)
	at org.xnio.nio.WorkerThread.run(WorkerThread.java:198)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.