martinspielmann / nexus3-crowd-plugin

Sonatype Nexus plugin for Atlassian Crowd integration
Apache License 2.0
39 stars 15 forks source link

NullPointerException at startup #60

Closed tobiasbenkner closed 6 years ago

tobiasbenkner commented 6 years ago

Hi there,

i found a NullPointerexception! When I start Nexus I get an error

Error

Error installing bundle listed in startup.properties with url: reference:file:nexus3-crowd-plugin.jar and startlevel: 200
java.lang.NullPointerException
    at org.apache.karaf.main.Main.destroy(Main.java:634)
    at org.sonatype.nexus.karaf.NexusMain.main(NexusMain.java:56)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62)
    at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:63)

Steps to reproduce

Dockerfile

FROM sonatype/nexus3

USER root

# Install curl
RUN yum install -y curl

# Download crowd plugin
RUN curl https://github.com/pingunaut/nexus3-crowd-plugin/releases/download/nexus3-crowd-plugin-3.4.2/nexus3-crowd-plugin-3.4.2.jar --output /opt/sonatype/nexus/system/nexus3-crowd-plugin.jar

# Install plugin
RUN echo "reference\:file\:nexus3-crowd-plugin.jar = 200" >> /opt/sonatype/nexus/etc/karaf/startup.properties

# Add Crowd Config
RUN touch /opt/sonatype/nexus/etc/crowd.properties
RUN echo "crowd.server.url=jira.example.com" >> /opt/sonatype/nexus/etc/crowd.properties
RUN echo "application.name=nexus" >> /opt/sonatype/nexus/etc/crowd.properties
RUN echo "application.password=nexus" >> /opt/sonatype/nexus/etc/crowd.properties
RUN echo "cache.authentication=false" >> /opt/sonatype/nexus/etc/crowd.properties

# setup permissions
RUN chown nexus:nexus -R /opt/sonatype/nexus

USER nexus

Run in Terminal

docker build -t test .
docker run --rm -ti test

Many thanks for your help :)

martinspielmann commented 6 years ago

Sorry for the late response. And thanks for that perfect bug report :+1: A new release with support for Nexus OSS 3.13.0-01 is on its way. One further question: May I use your Dockerfile in the README.md ?

tobiasbenkner commented 6 years ago

Of course you can use the Dockerfile :) thanks for your plugin

martinspielmann commented 6 years ago

Release is ready: https://github.com/pingunaut/nexus3-crowd-plugin/releases/tag/nexus3-crowd-plugin-3.5.0 Thanks again :)