JDO : Usage of DataNucleus within an OSGi environment
DataNucleus jars are OSGi bundles, and as such, can be deployed in an OSGi environment.
Being an OSGi environment care must be taken with respect to class-loading. In particular
the persistence property datanucleus.primaryClassLoader will need setting.
Please refer to the following guide(s) for assistance until a definitive guide can be
Some key points around integration with OSGi are as follows :-
- Any dependent jar that is required by DataNucleus needs to be OSGi enabled.
By this we mean the jar needs to have the MANIFEST.MF file including ExportPackage for
the packages required by DataNucleus. Failure to have this will result in ClassNotFoundException
when trying to load its classes.
- Use jdo-api.jar v3.0.1 or later since those are OSGi-enabled
- The Geronimo "jpa" jar that is included in the DataNucleus distribution is OSGi enabled.
- When using DataNucleus in an Eclipse Equinox OSGi environment set the persistence property
datanucleus.plugin.pluginRegistryClassName as org.datanucleus.plugin.EclipsePluginRegistry
- When using DataNucleus in other OSGi environments set the persistence property
datanucleus.plugin.pluginRegistryClassName to org.datanucleus.plugin.OSGiPluginRegistry
- If you redeploy a JDO-enabled OSGi application, likely you will need to refresh the javax.jdo and maybe