Management (JMX) with JVM MBean Server

DataNucleus provides MBeans that can be used to monitor, manage and configure DataNucleus at runtime. More about JMX here.

An MBean server is bundled with Sun JRE since its version 1.5, and you can easily activate DataNucleus MBeans registration by adding the DataNucleus Management Platform plugin found in jar datanucleus-management-{version}.jar to the classpath, and creating your PMF/EMF with the persistence property datanucleus.managedRuntime as true

Additionaly, setting a few system properties are necessary for configuring the Sun JMX implementation. The minimum properties required are the following:

  • com.sun.management.jmxremote
  • com.sun.management.jmxremote.authenticate
  • com.sun.management.jmxremote.ssl
  • com.sun.management.jmxremote.port=<port number>

Usage example:

java -cp TheClassPathInHere
     -Dcom.sun.management.jmxremote
     -Dcom.sun.management.jmxremote.authenticate=false
     -Dcom.sun.management.jmxremote.ssl=false
     -Dcom.sun.management.jmxremote.port=8001
     TheMainClassInHere

Once you start your application and DataNucleus is initialized you can browse DataNucleus MBeans using a tool called jconsole (jconsole is distributed with the Sun JDK) via the URL:

service:jmx:rmi:///jndi/rmi://hostName:portNum/jmxrmi

Note that the mode of usage is presented in this document as matter of example, and by no means we recommend to disable authentication and secured communication channels. Further details on the Sun JMX implementation and how to configure it properly can be found in here.

DataNucleus MBeans are registered in a MBean Server when DataNucleus is started up (e.g. upon JDO PMF or JPA EMF instantiation). To see the full list of DataNucleus MBeans, refer to the javadocs.



Management (JMX) with MX4J

DataNucleus provides MBeans that can be used to monitor, manage and configure DataNucleus at runtime. More about JMX here. To enable management using MX4J you must

  • specify the persistence property datanucleus.managedRuntime as true when creating the PMF/EMF
  • have the datanucleus-mx4j plugin jar in the CLASSPATH.

DataNucleus MBeans are registered in a MBean Server when DataNucleus is started up (e.g. upon JDO PMF or JPA EMF instantiation). To see the full list of DataNucleus MBeans, refer to the javadocs.