Follow this process to enable MBean discovery in a stand-alone Java application.

Procedure

  1. Instrument your code as specified in Model MBean Naming and Descriptor Data, or use Spring framework instrumented JAR files.
  2. Start the application with the spring.managed.application.name system property.

    For example,

    java -Dcom.sun.management.jmxremote -
    Dspring.managed.application.name="MyApplicationName" com.sample.MyApp

Results

The application name is set as the name of the discovered resource. For example, when using the code example in the procedure, the application name is set as MyApplicationName.