Please help to solve error message "Could not initialize class org.sonar.channel.ChannelDispatcher"

eclipse
web

(Albert Zeng) #1

I’ve an error when analysis java code in Eclipse, and the error message are as below,
An internal error occurred during: “SonarLint analysis of project Cosign (2,261 files to analyze, 0 excluded)”.
Could not initialize class org.sonar.channel.ChannelDispatcher

Please help me, thanks,


(Julien Henry) #2

Hi Albert,

Can you please provide the full stacktrace? You may find it either in SonarLint console or in Eclipse error logs.


(Albert Zeng) #3

Thanks for your reply, and the full error report are as below,

STATUS

pluginId org.eclipse.core.jobs
pluginVersion 3.9.3.v20180115-1757
code 2
severity 4
message An internal error occurred during: “SonarLint analysis of project Cosign (2,261 files to analyze, 0 excluded)”.
fingerprint 39c4045eef65881dc898258d2429785f

Exception:java.lang.NoClassDefFoundError: Could not initialize class org.sonar.channel.ChannelDispatcher
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at HIDDEN.HIDDEN(HIDDEN:-1)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

BUNDLES

name org.eclipse.core.jobs
version 3.9.3.v20180115-1757

name org.eclipse.core.resources
version 3.12.0.v20170417-1558

name org.sonarlint.eclipse.core
version 3.6.0.201806071228


(Julien Henry) #4

The stacktrace is not usable. I can’t remember having seen such thing before. Are you using connected mode? If yes, can you give us the list + version of the plugins in your SonarQube server (easy way is to give us the result of the WS /api/plugins/installed).


(Albert Zeng) #5

Yes, It’s happened under the connection mode.
My SonarQube server is v5.6.7 and the plugins list:
backelite-sonar-objective-c-plugin-0.6.2.jar
backelite-sonar-swift-plugin-0.2.4.jar
sonar-android-plugin-1.1.jar
sonar-cas-plugin-0.1.jar
sonar-checkstyle-plugin-2.4.jar
sonar-csharp-plugin-5.0-RC1.jar
sonar-cxx-plugin-0.9.4.jar
sonar-dependency-check-plugin-1.0.2.jar
sonar-findbugs-plugin-3.3.jar
sonar-java-plugin-4.1-build6350.jar
sonar-javascript-plugin-2.14-build2420.jar
sonar-php-plugin-2.9-RC1.jar
sonar-pmd-plugin-2.5.jar
sonar-python-plugin-1.7.0.1187.jar
sonar-scm-git-plugin-1.0.jar
sonar-scm-svn-plugin-1.0.jar
sonar-timeline-plugin-1.5.jar
sonar-useless-code-tracker-plugin-1.0.jar
sonar-web-plugin-2.5.0.476.jar
sonar-xml-plugin-1.4.jar
sonar-zap-plugin-1.0.0-0.jar


(Julien Henry) #6

I suggest you try to update your plugins (and also consider updating SonarQube itself, even if it should not change anything regarding this SonarLint issue). Few of them are non official releases:
sonar-java-plugin-4.1-build6350.jar
sonar-javascript-plugin-2.14-build2420.jar
sonar-php-plugin-2.9-RC1.jar


(Rama Krishna) #7

Even I am getting the same exception when doing analyze on whole project(individual files are working fine). I am getting this after updating sonarlint to latest version i.e., 3.6.0.
Underlying SonarQube version using is 6.7.3 and sonar java plugin is 5.3.0.

Below is the exception stack trace found in eclipse error log

java.lang.NoClassDefFoundError: Could not initialize class org.sonar.channel.ChannelDispatcher
	at org.sonar.plugins.web.lex.PageLexer.parse(PageLexer.java:90)
	at org.sonar.plugins.web.core.WebSensor.execute(WebSensor.java:98)
	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorWrapper.analyse(SensorWrapper.java:52)
	at org.sonarsource.sonarlint.core.analyzer.sensor.AllSensorsExecutor.executeSensor(AllSensorsExecutor.java:79)
	at org.sonarsource.sonarlint.core.analyzer.sensor.AllSensorsExecutor.execute(AllSensorsExecutor.java:67)
	at org.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor.execute(PhaseExecutor.java:36)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:141)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:76)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:152)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:339)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:329)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:150)
	at org.sonarlint.eclipse.core.internal.server.Server.runAnalysis(Server.java:277)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:453)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.runAnalysisAndUpdateMarkers(AnalyzeProjectJob.java:204)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.doRun(AnalyzeProjectJob.java:160)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.runInWorkspace(AbstractSonarProjectJob.java:43)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

(Julien Henry) #8

What is the version of the SonarWeb plugin you have on your SonarQube server?


(Rama Krishna) #9

sonar-web-plugin-2.6.0.1053.jar


(Rama Krishna) #10

Below is the complete list of plugins we are using
image


(Julien Henry) #12

FYI I reproduced a similar issue, but with a different stacktrace:

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at org.sonar.channel.ChannelDispatcher.<clinit>(ChannelDispatcher.java:32)
	at org.sonar.plugins.web.lex.PageLexer.parse(PageLexer.java:90)
	at org.sonar.plugins.web.core.WebSensor.execute(WebSensor.java:98)
	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorWrapper.analyse(SensorWrapper.java:52)
	at org.sonarsource.sonarlint.core.analyzer.sensor.AllSensorsExecutor.executeSensor(AllSensorsExecutor.java:79)
	at org.sonarsource.sonarlint.core.analyzer.sensor.AllSensorsExecutor.execute(AllSensorsExecutor.java:67)
	at org.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor.execute(PhaseExecutor.java:36)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:141)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:76)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:152)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:339)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:329)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:150)
	at org.sonarlint.eclipse.core.internal.server.Server.runAnalysis(Server.java:277)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.run(AnalyzeProjectJob.java:453)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.runAnalysisAndUpdateMarkers(AnalyzeProjectJob.java:204)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob.doRun(AnalyzeProjectJob.java:160)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.runInWorkspace(AbstractSonarProjectJob.java:43)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory cannot be found by org.sonarsource.sonarlint.core.sonarlint-core_3.7.0.1730
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 23 more

SonarLint for Eclipse 3.6.0.201806071228
SonarWeb 2.6.0.1053


Sonarlint crashes in eclipse, unable to analyze HTML file
(Julien Henry) #13

I have created a ticket:
https://jira.sonarsource.com/browse/SLE-274

Feel free to vote/follow it to be notified of progress on this topic.


Sonarlint crashes in eclipse, unable to analyze HTML file
(Johannes Becker) #14

Can this error be at least be silently thrown in the background like any other plugin does in Eclipse? A popup comes up every time I’m trying to save a file. This is such an annoying showstopper.


(Duarte Meneses) #15

The cause of the error will be fixed in the next update, so no need to silent it.