Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQ6.4: java.lang.NoClassDefFoundError: org/sonar/graph/DirectedGraphAccessor #1154

Closed
guwirth opened this issue Jun 5, 2017 · 5 comments · Fixed by #1157
Closed

SQ6.4: java.lang.NoClassDefFoundError: org/sonar/graph/DirectedGraphAccessor #1154

guwirth opened this issue Jun 5, 2017 · 5 comments · Fixed by #1157
Assignees
Labels
Milestone

Comments

@guwirth
Copy link
Collaborator

guwirth commented Jun 5, 2017

sonar-scanner output with SQ6.4

INFO: SonarQube Scanner 2.8
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Linux 3.13.0-115-generic amd64
INFO: User cache: /home/travis/.sonar/cache
INFO: Load global settings
INFO: Load global settings (done) | time=223ms
INFO: User cache: /home/travis/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=23ms
INFO: Download sonar-cxx-plugin-0.9.8-SNAPSHOT.jar
INFO: Download sonar-python-plugin-1.7.0.1195.jar
INFO: Download sonar-csharp-plugin-5.10.1.1411.jar
INFO: Download sonar-c-plugin-0.9.8-SNAPSHOT.jar
INFO: Download sonar-java-plugin-4.9.0.9858.jar
INFO: Download sonar-flex-plugin-2.3.jar
INFO: Download sonar-xml-plugin-1.4.2.885.jar
INFO: Download sonar-scm-git-plugin-1.2.jar
INFO: Download sonar-php-plugin-2.10.0.2087.jar
INFO: Download sonar-scm-svn-plugin-1.4.0.522.jar
INFO: Download sonar-javascript-plugin-3.0.0.4962.jar
INFO: SonarQube server 6.4.0
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=24ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=4ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=90ms
INFO: Load active rules
INFO: Load active rules (done) | time=6861ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=168ms
INFO: Publish mode
INFO: Project key: coverage_project
INFO: -------------  Scan coverage_project
INFO: Load server rules
INFO: Load server rules (done) | time=3477ms
INFO: Language is forced to c++
INFO: Initializer GenericCoverageSensor
INFO: Initializer GenericCoverageSensor (done) | time=0ms
INFO: Base dir: /home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project
INFO: Working dir: /home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/.sonar
INFO: Source paths: src
INFO: Source encoding: UTF-8, default locale: en_US
INFO: Index files
WARN: File '/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/src/Makefile' is ignored because it doesn't belong to the forced language 'c++'
INFO: 7 files indexed
INFO: Quality profile for c++: Sonar way
INFO: Sensor c++ SquidSensor [cxx]
WARN: [/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/src/component1.cc:1]: cannot find the sources for '#include <iostream>'
WARN: [/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/src/component2.cc:1]: cannot find the sources for '#include <iostream>'
WARN: [/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/src/integration_test.cc:1]: cannot find the sources for '#include <iostream>'
WARN: [/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/src/main.cc:1]: cannot find the sources for '#include <iostream>'
WARN: [/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/src/unit_test.cc:1]: cannot find the sources for '#include <iostream>'
INFO: Scanner found '1' report files
INFO: Parser will parse '1' report files
INFO: Added report '/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/ut-coverage.xml' (parsed by: CoberturaParser) to the coverage data
INFO: Scanner found '1' report files
INFO: Parser will parse '1' report files
INFO: Added report '/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/it-coverage.xml' (parsed by: CoberturaParser) to the coverage data
INFO: Scanner found '1' report files
INFO: Parser will parse '1' report files
INFO: Added report '/home/travis/build/SonarOpenCommunity/sonar-cxx/integration-tests/testdata/coverage_project/overall-coverage.xml' (parsed by: CoberturaParser) to the coverage data

Exception in thread "main" java.lang.NoClassDefFoundError: org/sonar/graph/DirectedGraphAccessor
	at org.sonar.cxx.sensors.squid.CxxSquidSensor.save(CxxSquidSensor.java:226)
	at org.sonar.cxx.sensors.squid.CxxSquidSensor.execute(CxxSquidSensor.java:188)
	at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
	at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:87)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:81)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:67)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:75)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:178)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:259)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:254)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:118)
	at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:117)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
	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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
	at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
	at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.ClassNotFoundException: org.sonar.graph.DirectedGraphAccessor
	at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
	... 33 more
@guwirth guwirth added the bug label Jun 5, 2017
@guwirth guwirth added this to the 0.9.8 milestone Jun 5, 2017
@yachoor
Copy link
Contributor

yachoor commented Jun 7, 2017

sonar-graph dependency was dropped in 6.4: SonarSource/sonarqube@1b00fef

I've been able to work-around this for now by manually adding sonar-graph-5.1.jar to sonar-cxx-plugin-0.9.8-SNAPSHOT.jar

@vpereira
Copy link

@yachoor could you please tell me how you did add the sonar-graph lib back?

@yachoor
Copy link
Contributor

yachoor commented Jun 12, 2017

I packed sonar-graph-5.1.jar to META-INF/lib directory in sonar-cxx-plugin-0.9.8-SNAPSHOT.jar and added string META-INF/lib/sonar-graph-5.1.jar to the end of Plugin-Dependencies in META-INF/MANIFEST.MF

@guwirth
Copy link
Collaborator Author

guwirth commented Jun 12, 2017

Or have a look to #1157

@asaykr
Copy link

asaykr commented Jun 3, 2019

I am still getting this error. Jenkins plugin sonar-scan 2.9 sonarqube Version 6.7.6 (build 38781)
Any help is appreciated!

09:29:19 09:29:19.942 INFO: ------------------------------------------------------------------------
09:29:19 09:29:19.942 ERROR: Error during SonarQube Scanner execution
09:29:19 java.lang.NoClassDefFoundError: org/sonar/graph/DirectedGraphAccessor
09:29:19 at org.sonar.cxx.sensors.squid.CxxSquidSensor.save(CxxSquidSensor.java:228)
09:29:19 at org.sonar.cxx.sensors.squid.CxxSquidSensor.execute(CxxSquidSensor.java:186)
09:29:19 at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
09:29:19 at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
09:29:19 at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
09:29:19 at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
09:29:19 at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:88)
09:29:19 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:177)
09:29:19 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
09:29:19 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
09:29:19 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:291)
09:29:19 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:286)
09:29:19 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:284)
09:29:19 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:264)
09:29:19 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
09:29:19 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
09:29:19 at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
09:29:19 at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
09:29:19 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
09:29:19 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
09:29:19 at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
09:29:19 at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
09:29:19 at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
09:29:19 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
09:29:19 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:29:19 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:29:19 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:29:19 at java.lang.reflect.Method.invoke(Method.java:498)
09:29:19 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
09:29:19 at com.sun.proxy.$Proxy0.execute(Unknown Source)
09:29:19 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
09:29:19 at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
09:29:19 at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
09:29:19 at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
09:29:19 at org.sonarsource.scanner.cli.Main.main(Main.java:61)
09:29:19 Caused by: java.lang.ClassNotFoundException: org.sonar.graph.DirectedGraphAccessor
09:29:19 at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
09:29:19 at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
09:29:19 at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

4 participants