Follow this process to enable MBean discovery in a stand-alone Java application.
- Instrument your code as specified in Model MBean Naming and Descriptor Data, or use Spring framework instrumented JAR files.
- Start the application with the spring.managed.application.name system property.
java -Dcom.sun.management.jmxremote - Dspring.managed.application.name="MyApplicationName" com.sample.MyApp
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.