java.lang.NoClassDefFoundError for javascript code check

Hello there,

I’m trying to run javascript application check:

  • SonarQube version 6.7.4 (build 38452)
  • Sonar Scanner version 4.2.0.1873

While run I get the following error:
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

Here is my properties file (http://sonar.example.com is a placeholder for a real DNS and this endpoint is accessible):
sonar.host.url=http://sonar.example.com
sonar.sourceEncoding=UTF-8
sonar.projectKey=test
sonar.projectName=test
sonar.projectVersion=1.0
sonar.sources=.
sonar.language=js
sonar.login=somesecrettext

What am I doing wrong?

hello @stanevich,

do you see the error when you run SonarQube or sonar-scanner? If SonarQube, you are using quite old version, consider upgrading at least to LTS version 7.9 .

This issue can happen when you run on Java 11, which doesn’t provide some XML modules by default. Using the latest version of SonarQube and it’s analyzers should fix it.

Solved.
Wrong host protocol: must be https instead of http in my case for SonarScanner ver.3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.