Sevntu Sonar plugin 1.19.0 does not work with Sonar 5.3 #436

Closed
romani opened this Issue Mar 9, 2016 · 6 comments

Projects

None yet

2 participants

@romani
Member
romani commented Mar 9, 2016
2016.03.07 17:08:26 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.NoSuchMethodError: com.google.common.io.Resources.newReaderSupplier(Ljava/net/URL;Ljava/nio/charset/Charset;)Lcom/google/common/io/InputSupplier;
    at org.sonar.squidbridge.rules.SqaleXmlLoader.reader(SqaleXmlLoader.java:165) ~[na:na]
    at org.sonar.squidbridge.rules.SqaleXmlLoader.loadXmlResource(SqaleXmlLoader.java:56) ~[na:na]
    at org.sonar.squidbridge.rules.SqaleXmlLoader.load(SqaleXmlLoader.java:52) ~[na:na]
    at org.sonar.plugins.checkstyle.CheckstyleRulesDefinition.extractRulesData(CheckstyleRulesDefinition.java:50) ~[na:na]
    at org.sonar.plugins.checkstyle.CheckstyleRulesDefinition.define(CheckstyleRulesDefinition.java:40) ~[na:na]
    at org.sonar.server.rule.RuleDefinitionsLoader.load(RuleDefinitionsLoader.java:54) ~[sonar-server-5.3.jar:na]
    at org.sonar.server.rule.RegisterRules.start(RegisterRules.java:100) ~[sonar-server-5.3.jar:na]

Sources:

"CheckstyleRulesDefinition.extractRulesData"

https://github.com/SonarSource/sonar-checkstyle/blob/master/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleRulesDefinition.java#L40

"SqaleXmlLoader.reader"

https://github.com/SonarSource/sslr-squid-bridge/blob/master/src/main/java/org/sonar/squidbridge/rules/SqaleXmlLoader.java#L165

Sonar use guava 10.0.1:

/var/tmp/$ git clone https://github.com/SonarSource/sslr-squid-bridge/ && cd sslr-squid-bridge
/var/tmp/sslr-squid-bridge [master|✔] $ mvn dependency:list | grep "guava"
[INFO]    com.google.guava:guava:jar:10.0.1:compile

com.google.common.io.Resources.newReaderSupplier

https://github.com/google/guava/blob/v10.0/guava/src/com/google/common/io/Resources.java#L73

in latest code there are such method - https://github.com/google/guava/blob/master/guava/src/com/google/common/io/Resources.java

@romani
Member
romani commented Mar 9, 2016

screenshot-diff-1 18 0-1 19 0

@cypai
Contributor
cypai commented Mar 9, 2016

This method was removed in guava v 18.0

@cypai
Contributor
cypai commented Mar 10, 2016

There should not be inner jars, for example checkstyle-all.jar has everything in classes

@cypai cypai pushed a commit to cypai/sevntu.checkstyle that referenced this issue Mar 10, 2016
Charlie Pai Issue #436: Hotfix for sonar failure e7382b7
@cypai
Contributor
cypai commented Mar 10, 2016

Also during project analysis, guava v 17 does not have the following method:

Caused by: java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V
    at org.sonar.plugins.checkstyle.CheckstyleExecutor.execute(CheckstyleExecutor.java:97)
    at org.sonar.plugins.checkstyle.CheckstyleSensor.analyse(CheckstyleSensor.java:57)
    at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
    at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
    at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
    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 org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
    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.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
    ... 22 more

Last guava version with this was v 15.0

@cypai
Contributor
cypai commented Mar 10, 2016

mvn clean install in sevntu-checks does not work with guava 15.0:

java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/InputStream;)V
    at com.puppycrawl.tools.checkstyle.PackageNamesLoader.getPackageNames(PackageNamesLoader.java:156)
    at com.puppycrawl.tools.checkstyle.Checker.finishLocalSetup(Checker.java:151)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:134)
    at com.github.sevntu.checkstyle.BaseCheckTestSupport.createChecker(BaseCheckTestSupport.java:116)
    at com.github.sevntu.checkstyle.BaseCheckTestSupport.verify(BaseCheckTestSupport.java:65)
    at com.github.sevntu.checkstyle.checks.coding.CustomDeclarationOrderCheckTest.gettersSetters(CustomDeclarationOrderCheckTest.java:105)
@cypai cypai pushed a commit to cypai/sevntu.checkstyle that referenced this issue Mar 10, 2016
Charlie Pai Issue #436: Hotfix for sonar failure f0c46f1
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Mar 10, 2016
@cypai cypai Issue #436: Hotfix for sonar crash 90a20ee
@cypai cypai added a commit to cypai/sevntu.checkstyle that referenced this issue Mar 10, 2016
@cypai cypai + Charlie Pai Issue #436: Hotfix for sonar crash 98ca2c0
@romani romani added this to the 1.19.1 milestone Mar 10, 2016
@romani
Member
romani commented Mar 10, 2016

fix is merged.
proper shading will be done at #440 .

@romani romani closed this Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment