a-langer / nexus-sso

Single Sign-On patch for Nexus OSS
Eclipse Public License 1.0
72 stars 17 forks source link

ClassNotFoundException: pac4jRealm not found by org.sonatype.nexus.security #34

Open IstvanCsVarga opened 4 days ago

IstvanCsVarga commented 4 days ago

Description: I am encountering a ClassNotFoundException for pac4jRealm after updating to the latest version of the nexus-pac4j-plugin. The error occurs when starting the Nexus instance. This issue started after the last three commits in the repository.

Error Log:

java.lang.ClassNotFoundException: pac4jRealm not found by org.sonatype.nexus.security [147]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1565)
    at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
    at org.sonatype.nexus.security.internal.RealmManagerImpl.resolveRealms(RealmManagerImpl.java:250)
    at org.sonatype.nexus.security.internal.RealmManagerImpl.installRealms(RealmManagerImpl.java:222)
    at org.sonatype.nexus.security.internal.RealmManagerImpl.doStart(RealmManagerImpl.java:115)
    at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:69)
    at org.sonatype.nexus.security.internal.RealmManagerImpl$$EnhancerByGuice$$4dc782d.GUICE$TRAMPOLINE(<generated>)
    at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:74)
    at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
    at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:206)
    at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:57)
    at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
    at com.google.inject.internal.InterceptorStackCallback.invoke(InterceptorStackCallback.java:55)
    at org.sonatype.nexus.security.internal.RealmManagerImpl$$EnhancerByGuice$$4dc782d.start(<generated>)
    at org.sonatype.nexus.security.internal.DefaultSecuritySystem.doStart(DefaultSecuritySystem.java:129)
    at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:69)
    at org.sonatype.nexus.security.internal.DefaultSecuritySystem$$EnhancerByGuice$$4561eaa.GUICE$TRAMPOLINE(<generated>)
    at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:74)
    at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
    at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:206)
    at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:57)
    at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75)
    at com.google.inject.internal.InterceptorStackCallback.invoke(InterceptorStackCallback.java:55)
    at org.sonatype.nexus.security.internal.DefaultSecuritySystem$$EnhancerByGuice$$4561eaa.start(<generated>)
    at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:210)
    at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:121)
    at org.sonatype.nexus.extender.NexusContextListener.moveToPhase(NexusContextListener.java:334)
    at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:231)
    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1597)
    at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
    at java.base/java.lang.Thread.run(Thread.java:829)

Steps to Reproduce:

  1. Update to the latest version of the nexus-pac4j-plugin (3.70.1-java11-ubi-BETA-2).
  2. Build the Docker image using the provided Dockerfile.
  3. Start the Nexus instance.
  4. Observe the ClassNotFoundException error in the logs.

Additional Information:

Please let me know if you need any additional information to help diagnose and resolve this issue.

a-langer commented 2 days ago

Hi,

Yes, there are issues found in this build, see https://github.com/a-langer/nexus-sso/issues/31#issuecomment-2448426817. Thank you for providing additional information. The bug will be fixed in the next BETA version or in the next stable release.