Search code examples
c#sonarqubeillegalargumentexceptionsonar-runner

SonarQube 4.3 - Analyze on different Machine - IllegalArgumentException - Dependency not found


I currently updated to SonarQube 4.3 and sonar-runner 2.4 to analyze projects in my build environment (2 servers - one that hosts sonar - one that runs sonar-runner).

With SonarQube version 4.2 and sonar-runner 2.0 anaysis was fine and worked without problems, now after upgrade, server that runs sonar-runner throws exception (I intentionally removed the servername; I already added the -X debug switch to sonar-runner):

07:55:35.190 INFO  - Install plugins
07:55:35.190 DEBUG - Download index of plugins
07:55:35.190 DEBUG - Download: http://[Server that hosts sonar]/deploy/plugins/index.txt (no proxy)
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 2.864s
Final Memory: 3M/77M
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:100)
    at org.sonar.runner.Main.executeTask(Main.java:70)
    at org.sonar.runner.Main.execute(Main.java:59)
    at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalArgumentException: Dependency META-INF/lib/activation-1.1.1.jar can not be found in sonar-email-notifications-plugin-4.3.jar
    at org.sonar.core.plugins.PluginJarInstaller.copyDependencies(PluginJarInstaller.java:53)
    at org.sonar.core.plugins.PluginJarInstaller.install(PluginJarInstaller.java:40)
    at org.sonar.batch.bootstrap.BatchPluginJarInstaller.installToCache(BatchPluginJarInstaller.java:40)
    at org.sonar.batch.bootstrap.BatchPluginRepository.doStart(BatchPluginRepository.java:81)
    at org.sonar.batch.bootstrap.BatchPluginRepository.start(BatchPluginRepository.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
    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:1015)
    at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
    at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
    at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
    at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
    at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
INFO: ------------------------------------------------------------------------
    ... 9 more
Program returned code  : 1

If i access the /deploy/plugins/index.txt from server that runs sonar-runner (from browser) i get the index.txt so i think it shouldn't be a permission issue, or am i wrong here?

Also if i run sonar-runner from server that hosts sonar (so only local, on same machine) it works without problems.

Could you please help me on that one? Do you need further information?

Thx!


Solution

  • The problem was that the local sonar plugin cache (C:\users[local user]\.sonar) on the server that runs sonar analysis had modifications and the plugin was corrput.

    I just deleted the folder (C:\users[local user]\.sonar) on server that runs the sonar analysis and rerun the analysis. The sonar analysis fetches the plugins again from the server that hosts the sonar instance and therefor gets the correct (= not corrupt) jar-archives.

    [info: this was already suggested by a different user, but was removed by site admin. so thx for mr. unknown for the suggestion]