SonarQube
  1. SonarQube
  2. SONAR-1685

The maven plugin fails if the property sonar.host.url ends with a slash

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: Maven Plugin
    • Labels:
      None
    • Number of attachments :
      0

      Activity

      Simon Brandhof made changes -
      Field Original Value New Value
      Status Open [ 1 ] Resolved [ 5 ]
      Assignee Simon Brandhof [ simon.brandhof ]
      Resolution Fixed [ 1 ]
      Freddy Mallet made changes -
      Status Resolved [ 5 ] Closed [ 6 ]
      Hide
      Michael Wenig added a comment -

      A similar problem occurs if the server is just not running.

      I would suggest to rethink and check the exception handling according to the http-downloads and to
      log the downloads.
      If the sonar.host.url ends with a slash it should be visible in the log such as

      downloading http://myserver//deploy/jdbc-driver.jar
      
      error downloading: 404 not found: //deploy/jdbc-driver.jar
      (eventually + stacktrace)
      

      instead the following comes which does not lead to a wrong url in any way:

      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] PicoLifecycleException: method 'public void org.sonar.api.database.AbstractDatabaseConnector.start()', instance 'org.sonar.api.database.DriverDatabaseConnector@2a28ff7, java.lang.RuntimeException: wrapper
      com.mysql.jdbc.Driver
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.api.database.AbstractDatabaseConnector.start()', instance 'org.sonar.api.database.DriverDatabaseConnector@2a28ff7, 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.adapters.InstanceAdapter.start(InstanceAdapter.java:108)
      	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.batch.Batch.execute(Batch.java:56)
      	at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:142)
      	at org.sonar.maven.SonarMojo.execute(SonarMojo.java:133)
      	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
      	at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
      	at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      	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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      	at hudson.maven.agent.Main.launch(Main.java:165)
      	at hudson.maven.MavenBuilder.call(MavenBuilder.java:165)
      	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:681)
      	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:625)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:270)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.RuntimeException: wrapper
      	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:130)
      	... 43 more
      Caused by: org.sonar.api.database.DatabaseException: Cannot open connection to database: SQL driver not found com.mysql.jdbc.Driver
      	at org.sonar.api.database.AbstractDatabaseConnector.testConnection(AbstractDatabaseConnector.java:182)
      	at org.sonar.api.database.AbstractDatabaseConnector.start(AbstractDatabaseConnector.java:94)
      	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)
      	... 42 more
      Caused by: java.sql.SQLException: SQL driver not found com.mysql.jdbc.Driver
      	at org.sonar.api.database.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:87)
      	at org.sonar.api.database.AbstractDatabaseConnector.testConnection(AbstractDatabaseConnector.java:178)
      	... 48 more
      Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      	at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:592)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      	at org.sonar.api.database.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:83)
      	... 49 more
      [INFO] ------------------------------------------------------------------------
      
      
      Show
      Michael Wenig added a comment - A similar problem occurs if the server is just not running. I would suggest to rethink and check the exception handling according to the http-downloads and to log the downloads. If the sonar.host.url ends with a slash it should be visible in the log such as downloading http: //myserver//deploy/jdbc-driver.jar error downloading: 404 not found: //deploy/jdbc-driver.jar (eventually + stacktrace) instead the following comes which does not lead to a wrong url in any way: [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] PicoLifecycleException: method ' public void org.sonar.api.database.AbstractDatabaseConnector.start()', instance 'org.sonar.api.database.DriverDatabaseConnector@2a28ff7, java.lang.RuntimeException: wrapper com.mysql.jdbc.Driver [INFO] ------------------------------------------------------------------------ [INFO] Trace org.picocontainer.PicoLifecycleException: PicoLifecycleException: method ' public void org.sonar.api.database.AbstractDatabaseConnector.start()', instance 'org.sonar.api.database.DriverDatabaseConnector@2a28ff7, 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.adapters.InstanceAdapter.start(InstanceAdapter.java:108) 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.batch.Batch.execute(Batch.java:56) at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:142) at org.sonar.maven.SonarMojo.execute(SonarMojo.java:133) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) 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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at hudson.maven.agent.Main.launch(Main.java:165) at hudson.maven.MavenBuilder.call(MavenBuilder.java:165) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:681) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:625) at hudson.remoting.UserRequest.perform(UserRequest.java:114) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:270) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang. Thread .run( Thread .java:619) Caused by: java.lang.RuntimeException: wrapper at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:130) ... 43 more Caused by: org.sonar.api.database.DatabaseException: Cannot open connection to database: SQL driver not found com.mysql.jdbc.Driver at org.sonar.api.database.AbstractDatabaseConnector.testConnection(AbstractDatabaseConnector.java:182) at org.sonar.api.database.AbstractDatabaseConnector.start(AbstractDatabaseConnector.java:94) 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) ... 42 more Caused by: java.sql.SQLException: SQL driver not found com.mysql.jdbc.Driver at org.sonar.api.database.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:87) at org.sonar.api.database.AbstractDatabaseConnector.testConnection(AbstractDatabaseConnector.java:178) ... 48 more Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang. ClassLoader .loadClass( ClassLoader .java:307) at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:592) at java.lang. ClassLoader .loadClass( ClassLoader .java:252) at org.sonar.api.database.DriverDatabaseConnector.getConnection(DriverDatabaseConnector.java:83) ... 49 more [INFO] ------------------------------------------------------------------------
      Hide
      Michael Wenig added a comment -

      The problem when server is not running is described in SONAR-2064.

      Show
      Michael Wenig added a comment - The problem when server is not running is described in SONAR-2064 .

        People

        • Assignee:
          Simon Brandhof
          Reporter:
          Simon Brandhof
        • Votes:
          1 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: