SonarQube Runner
  1. SonarQube Runner
  2. SONARUNNER-7

When launching the Sonar Runner without providing the sonar-project.properties and/or the project kee, a NullPointerException is thrown without any additional information

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Here is the error stack trace :

      10:55:12.851 WARN  Derby database should be used for evaluation purpose only
      10:55:12.854 INFO  Create JDBC datasource
      10:55:13.250 INFO  Initializing Hibernate
      Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.index.DefaultIndex.start()', instance 'org.sonar.batch.index.DefaultIndex@1ad997f9, java.lang.RuntimeException: wrapper
      	at org.sonar.runner.Runner.delegateExecution(Runner.java:155)
      	at org.sonar.runner.Runner.execute(Runner.java:58)
      	at org.sonar.runner.Main.main(Main.java:52)
      Caused by: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.batch.index.DefaultIndex.start()', instance 'org.sonar.batch.index.DefaultIndex@1ad997f9, java.lang.RuntimeException: wrapper
      	at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77)
      	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:132)
      	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:115)
      	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
      	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
      	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
      	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
      	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
      	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:996)
      	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:989)
      	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:746)
      	at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:70)
      	at org.sonar.batch.bootstrap.Module.start(Module.java:82)
      	at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:103)
      	at org.sonar.batch.bootstrap.Module.start(Module.java:83)
      	at org.sonar.batch.Batch.execute(Batch.java:74)
      	at org.sonar.runner.Launcher.executeBatch(Launcher.java:60)
      	at org.sonar.runner.Launcher.execute(Launcher.java:53)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.sonar.runner.Runner.delegateExecution(Runner.java:152)
      	... 2 more
      Caused by: java.lang.RuntimeException: wrapper
      	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:130)
      	... 23 more
      Caused by: java.lang.NullPointerException
      	at org.sonar.api.resources.Resource.hashCode(Resource.java:242)
      	at java.util.HashMap.put(HashMap.java:372)
      	at org.sonar.batch.index.DefaultIndex.doStart(DefaultIndex.java:98)
      	at org.sonar.batch.index.DefaultIndex.start(DefaultIndex.java:93)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
      	... 22 more
      
      

        Issue Links

          Activity

          Hide
          Jean-Pierre Fayolle added a comment -

          I also had this error because I indicated only the path = the directory, and not the properties file.
          I was confused by the field name "Path to project properties" and by the fact that with the Sonar Runner without Jenkins, you cannot indicate a specific file but only the Project directory.
          The error occurs also if there is an error in the path (which means the path cannot be found).

          Show
          Jean-Pierre Fayolle added a comment - I also had this error because I indicated only the path = the directory, and not the properties file. I was confused by the field name "Path to project properties" and by the fact that with the Sonar Runner without Jenkins, you cannot indicate a specific file but only the Project directory. The error occurs also if there is an error in the path (which means the path cannot be found).
          Hide
          Evgeny Mandrikov added a comment -

          sonar-project.properties is not mandatory because properties can be specified via command-line, so I suppose that this issue superceded by SONARPLUGINS-1466, which prevents NullPointerException

          Show
          Evgeny Mandrikov added a comment - sonar-project.properties is not mandatory because properties can be specified via command-line, so I suppose that this issue superceded by SONARPLUGINS-1466 , which prevents NullPointerException
          Hide
          Freddy Mallet added a comment -

          Manually tested

          Show
          Freddy Mallet added a comment - Manually tested

            People

            • Assignee:
              Evgeny Mandrikov
              Reporter:
              Freddy Mallet
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: