Starting NxRM as a service may result in a Karaf NullPointerException on start-up


Rapidly stopping and starting Nexus 3 when configured as a service[1] (for example during  DR testing) may result in Nexus not starting up at all and with the following exception in the logging:

2021-05-07 15:18:13,640+0000 INFO [FelixStartLevel] *SYSTEM - start
2021-05-07 15:18:14,285+0000 INFO [FelixStartLevel] *SYSTEM - Fast FeaturesService starting
2021-05-07 15:18:14,364+0000 ERROR [FelixStartLevel] *SYSTEM org.apache.karaf.deployer.features.FeatureDeploymentListener - Unable to update deployed features for bundle: org.apache.felix.framework - 5.6.12
java.lang.NullPointerException: null
at org.apache.karaf.deployer.features.FeatureDeploymentListener.bundleChanged(
at org.apache.karaf.deployer.features.FeatureDeploymentListener.init(
at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.registerListener(
at org.apache.karaf.deployer.features.osgi.Activator.doStart(
at org.apache.karaf.util.tracker.BaseActivator.start(
at org.apache.felix.framework.util.SecureAction.startActivator(
at org.apache.felix.framework.Felix.activateBundle(
at org.apache.felix.framework.Felix.startBundle(
at org.apache.felix.framework.Felix.setActiveStartLevel(


  • This issue has been observed in-frequently after rapid system restarts (where NxRM starts automatically via systemd).
  • The error occurs right at the beginning of the boot sequence
  • Any logging or thread dumps captured at the time of the issue do not give any hints as to where the problem is.

Related Jiras

Check and workaround

Example commands to find the corrupted files:

# Change below two variables for your environment. _INSTALL_DIR should end with the version string

cd $(dirname ${_INSTALL_DIR%/});
curl -o "/tmp/nexus-unix.tar.gz" -L "${_VER}-unix.tar.gz";
tar --diff -f "/tmp/nexus-unix.tar.gz" nexus-${_VER}/etc/karaf | grep -vE '(Uid|Gid|Mod time) differs'

Example commands for restoring all files under "karaf" directory:

cd $(dirname ${_INSTALL_DIR%/});
tar -xv -f "/tmp/nexus-unix.tar.gz" nexus-${_VER}/etc/karaf


Possible cause

This could be a race condition where mounted disks (relevant to Nexus Repository Manager) are not mounted quick enough and/or the network is not fully initialised and up' before 'systemd' kicks in.

If you do have a reliance on network mounts then ensuring these are fully available to Nexus before the Nexus service starts should hopefully overcome this issue.

  • establish which mounts are relied upon (either for blobstores or Nexus data)
  • run
    systemctl list-units | grep '.mount'
    - to get the names of these mount 'units'
  • add both the network and the mounts to the service [Unit] section options for 'Requires' and 'After' [2]
... <required mount 1>.mount <required mount2>.mount <required mount 1>.mount <required mount2>.mount








Have more questions? Submit a request


Article is closed for comments.