Servlet Configuration

The configuration of the REST API consists in the deployment of jar libraries to the classpath and the configuration of the servlet in the /WEB-INF/web.xml . After it's configured, all persistent classes are automatically exposed via RESTful HTTP interface. You need to have enhanced versions of the model classes in the CLASSPATH.


DataNucleus REST API requires the libraries: datanucleus-core , datanucleus-api-rest , datanucleus-api-jdo , jdo-api , as well as datanucleus-rdbms (or whichever datastore you wish to persist to if not RDBMS). You would also require JPA API jar if using JPA metadata (XML/annotations) in your model classes. In WAR files, these libraries are deployed under the folder /WEB-INF/lib/ .


The DataNucleus REST Servlet class implementation is . It has to be configured in the /WEB-INF/web.xml file, and it takes one initialisation parameter.

Parameter Description
persistence-context Name of a PMF (if using jdoconfig.xml ), or the name of a persistence-unit (if using persistence.xml ) accessible to the servlet
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

<web-app xmlns="" version="2.5">



changing myPMFName to the name of your PMF, or the name of your persistence-unit, and changing dn/* to the URL pattern where you want DataNucleus REST API calls to be answered.