We have upgraded the Sonarqube version from 9.9 to 10.5, from then we are facing issues with azure d

Hi Team,

Need your help for below issue . we upgraded sonarqube server but it not support from client scanner. Please help us to resolving issue ASAP
upgrading from 9.9.1 to 10.5
System information Operating system :- Redhat
Java version :- 17
Database provider/version :- Mssql 2018 )

  • Facing issue :- azure devops build pipeline we use SonarQube task and
    during SonarQube scanner we getting below Error on azure devops Build agent
[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
[error]java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the 
Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime 
(class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
[error]at java.base/java.lang.ClassLoader.defineClass1(Native Method)


[error]Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
Error: A JNI error has occurred, please check your installation and try again
[error]java.lang.UnsupportedClassVersionError: org/sonarsource/scanner/cli/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0


java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor

Thanks

Hi,

Welcome to the community!

This guide should help.

 
Ann

i tried a few versions of JDK 17 and java 20 on my windows machine one by one.
openjdk 17.0.11
system-environment-variable JAVA_HOME to the right version,

java 17 agent 7

java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor
##[error]at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:194)
	at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:194)
##[error]at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.completeScannerExtensions(AbstractExtensionDictionary.java:81)

==

java 17 agent 5

ERROR: Error during SonarScanner execution
##[error]java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor
java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor
##[error]at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:194)

java 20 on agent 1

##[error]ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Unable to load components interface org.sonar.api.batch.sensor.Sensor
##[error]at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:194)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.completeScannerExtensions(AbstractExtensionDictionary.java:81)
	at org.sonar.core.platform.SpringComponentContainer.getComponentsByType(SpringComponentContainer.java:194)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.completeScannerExtensions(AbstractExtensionDictionary.java:81)
##[error]at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.getExtensions(AbstractExtensionDictionary.java:76)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionary.getFilteredExtensions(AbstractExtensionDictionary.java:66)
	at org.sonar.scanner.sensor.ModuleSensorExtensionDictionary.selectSensors(ModuleSensorExtensionDictionary.java:46)

Hi,

Would you care to provide the complete stacktrace?

 
Ann