Troubleshooting JMX connection issues

If you experience problems connecting remotely to an MBean server using JMX (as described in Using JConsole to access the Derby MBeans and Using custom Java code to access the Derby MBeans), it may be helpful to obtain some tracing information. The JMX implementation in the Oracle JDK uses the java.util.logging API to log JMX traces. For example, in order to trace SSL connection issues, set the system property java.util.logging.config.file as shown in the following:

java -Djava.util.logging.config.file=logging.properties MyJmxClient

With JConsole, a separate logging window will appear if you specify the following option when you start JConsole (see Using JConsole to access the Derby MBeans), as long as the logging.properties file is found:

-J-Djava.util.logging.config.file=logging.properties

The logging.properties file should specify log handlers and logging levels, as in the following example:

handlers = java.util.logging.ConsoleHandler
.level = INFO

java.util.logging.ConsoleHandler.level=FINEST
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter

 // Level FINEST is suitable for diagnosing SSL-related JMX remote
 //  connection issues.
javax.management.level=FINEST
javax.management.remote.level=FINEST

The blog entry https://blogs.oracle.com/jmxetc/entry/troubleshooting_connection_problems_in_jconsole provides additional hints and tips.

Related reference
Introduction to the Derby MBeans
Enabling and disabling JMX
Using JConsole to access the Derby MBeans
Using custom Java code to access the Derby MBeans