SensorsPhaseHandler class not found

sonarlint

(Christian Grant) #1

Hi,

I’m getting the SensorsPhaseHandler class not found message when trying to bind to one my Eclipse projects to a SonarQube server.

I’m using Eclipse Java IDE Version: 2018-09 (4.9.0) with SonarLint 4.0.

The SonarQube server I’m connecting to is 5.6.3 (according to the SonarQube webpage).

I’ve removed the server name from the output below

!ENTRY org.eclipse.core.jobs 4 2 2018-11-01 10:49:06.997
!MESSAGE An internal error occurred during: “Update SonarLint binding data from ‘XXXX-XXXX-XXXX’”.
!STACK 0
java.lang.NoClassDefFoundError: org/sonar/api/batch/events/SensorsPhaseHandler
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
at com.sonarsource.A.A.C.define(Unknown Source)
at org.sonarsource.sonarlint.core.container.global.ExtensionInstaller.install(ExtensionInstaller.java:62)
at org.sonarsource.sonarlint.core.container.global.GlobalExtensionContainer.doBeforeStart(GlobalExtensionContainer.java:35)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonarsource.sonarlint.core.container.storage.StorageContainer.doAfterStart(StorageContainer.java:126)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:118)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$2(ConnectedSonarLintEngineImpl.java:176)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withRwLock(ConnectedSonarLintEngineImpl.java:325)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.update(ConnectedSonarLintEngineImpl.java:169)
at org.sonarlint.eclipse.core.internal.server.Server.updateStorage(Server.java:326)
at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:50)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ClassNotFoundException: org.sonar.api.batch.events.SensorsPhaseHandler
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)
… 26 more

Any advice appreciated. This is the first time I’ve tried to do this.

Thanks,
Christian


(Duarte Meneses) #2

Hi Christian,

Could you please let us know which plugins (and which version) are installed in the SonarQube server?

Thanks.


(Christian Grant) #3

I’ve emailed the team that look after the SonarQube server in our company.

Will update once I get a response.

Cheers.


(Duarte Meneses) #4

Ok. Alternatively you can also get the list by accessing [sonarqubeUrl]/api/plugins/installed.


(Christian Grant) #5

I get {“errors”:[{“msg”:“Insufficient privileges”}]} when I try to view the plugins.

The platform team from my company have given me a list of the plugins but with no version numbers, thus I’m still waiting for them to get back to me with some full information.


(Christian Grant) #6

Hi Duarte,

Please find the list of plugins:

Plug-in Name Installed version
Android 1.1 installed
CSS / SCSS / Less 3.1 installed
Checkstyle 2.4 installed
Clover 3.1 installed
Cobertura Coverage 1.7 installed
Findbugs External Analysers 3.4.3 installed
Generic Coverage 1.2 installed
GitLab Integration 2.1.0 installed
Governance Governance 1.2.1.1926 installed
Groovy Languages 1.4 installed
LDAP Integration 2.1.0.507 installed
PMD 2.6 installed
Puppet 1.4 installed
Rules Compliance Index (RCI) 1.0.1 installed
SVG Badges 3.0.1 installed
Scala 0.0.2 installed
Scoverage 5.1.3 installed
SonarABAP Languages 3.3 installed
SonarC# Languages 5.5.2.537 installed
SonarCFamily Languages 4.4.0.6266 installed
SonarCOBOL Languages 4.0.0.2525 installed
SonarHTML Languages 2.5.0.476 installed
SonarJS Languages 2.18.0.3454 installed
SonarJava Languages 4.15.0.12310 installed
SonarPHP Languages 2.9.1.1705 installed
SonarPLSQL Languages 3.0.1.1427 installed
SonarPython Languages 1.8.0.1496 installed
SonarSwift Languages 3.0.0.1969 installed
SonarTS Languages 1.1.0.1079 installed
SonarTSQL Languages 1.0.1.2094 installed
SonarVB Languages 3.0.1.293 installed
Code Analyzer for VB.NET Updates:
SonarXML Languages 1.4.1 installed
Sonargraph 3.5 installed
TFVC 2.1.2 installed
Widget Lab 1.8.1 installed

(Duarte Meneses) #7

Hi,

Thanks for the list.
You have several plugins that are too old and no longer supported by the latest version of SonarLint. To use SonarLint 4.0, you will have to update, in SonarQube, all plugins that don’t meet the minimum versions supported by SonarLint.
SonarLint should have warned you about it before attempting do load them.

The specific error that you are seeing is probably caused by SonarLint trying to load SonarCFamily 4.4.0.6266. The minimal version supported for this plugin is 5.0.

You can see here the minimal versions supported by SonarLint for most of sonarlint-compatible plugins (by their keys): https://github.com/SonarSource/sonarlint-core/blob/master/core/src/main/resources/plugins_min_versions.txt