Nexus can't startup due `NullInjectedIntoNonNullable` on `RemovedAssetSender.java:48` - Sonatype Nexus Repository - Sonatype Community

Nexus can’t startup due NullInjectedIntoNonNullable on RemovedAssetSender.java:48

post by iseki on Jul 22, 2022

I’m trying to develop an integration. But after installing my bundle, the Nexus can’t startup.

I found the following error report in the nexus.log:

2022-07-22 06:43:39,735+0000 WARN  [FelixStartLevel]  *SYSTEM Sisu - Problem adding: org.eclipse.sisu.inject.LazyBeanEntry@3d294f60 to: org.sonatype.nexus.internal.event.EventManagerImpl@51e79b51 via: org.sonatype.nexus.internal.event.EventManagerImpl$EventAwareMediator@406779da
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) [Guice/NullInjectedIntoNonNullable]: null returned by binding at LocatorWiring
  but the 1st parameter of RemovedAssetSender.<init>(RemovedAssetSender.java:48) is not @Nullable
  
  at LocatorWiring
  at RemovedAssetSender.<init>(RemovedAssetSender.java:48)
      \_ for 1st parameter
  at /
      \_ installed by: NexusBundleModule -> SpaceModule
  while locating RemovedAssetSender
  while locating Object annotated with *

Learn more:
https://github.com/google/guice/wiki/NULL_INJECTED_INTO_NON_NULLABLE

1 error

======================
Full classname legend:
======================
LocatorWiring:      "org.eclipse.sisu.wire.LocatorWiring"
NexusBundleModule:  "org.sonatype.nexus.extender.modules.NexusBundleModule"
RemovedAssetSender: "com.sonatype.nexus.clm.internal.orient.RemovedAssetSender"
SpaceModule:        "org.eclipse.sisu.space.SpaceModule"
========================
End of classname legend:
========================

at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
        at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1103)
        at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
        at org.sonatype.nexus.internal.event.EventManagerImpl$EventAwareMediator.add(EventManagerImpl.java:81)
        at org.sonatype.nexus.internal.event.EventManagerImpl$EventAwareMediator.add(EventManagerImpl.java:1)
        at org.eclipse.sisu.inject.WatchedBeans.add(WatchedBeans.java:80)
        at org.eclipse.sisu.inject.InjectorBindings.publishWildcardMatches(InjectorBindings.java:185)
        at org.eclipse.sisu.inject.InjectorBindings.subscribe(InjectorBindings.java:86)
        at org.eclipse.sisu.inject.DefaultBeanLocator.watch(DefaultBeanLocator.java:80)
        at org.sonatype.nexus.internal.event.EventManagerImpl.doStart(EventManagerImpl.java:93)
        at org.sonatype.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:99)
        at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:199)
        at org.sonatype.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:99)
        at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:199)
        at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:111)
        at org.sonatype.nexus.extender.NexusContextListener.moveToPhase(NexusContextListener.java:319)
        at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:216)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1597)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(StartLevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:750)

After that, all things failed. I found lots of errors such as java.lang.ClassNotFoundException: org.sonatype.nexus.repository.RepositoryTaskSupport not found by com.sonatype.nexus.plugins.nexus-repository-npm [323]

I’m the beginner of plugin development. If you have any idea for it, please let me know. Thank you

post by mpiggott on Jul 25, 2022

I’m afraid I don’t really have a suggestion for you. It would seem something your bundle does is affecting the availability of the standard Nexus bundles.

post by iseki on Jul 26, 2022

The problem is solved. It’s because something which is not OSGi-ready is bundled. Change the bundle settings and inline the dependencies in the main jar to avoid unexpected effects on Nexus.

post by Michael_Greenwood on May 6, 2025

Can you explain more what you did here? I am facing the same issues. Is it in the nexus-bundle import/export package settings I need to change things?

post by iseki on Jun 9, 2025

My solution: Bundle all dependencies except nexus related into a single jar, and don’t mention them in the import/export settings.(Because they may not be OSGi ready.)