Current we are using sonarqube 7.9 enterprise version, we have upgarded Java analyzer plugin to 6.3, few week back I have reported issue on [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project phts-aggregator: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: javax/servlet/jsp/jstl/core/ConditionalTagSupport
As per sonar support we have excluded the JSP files from scan and we are good for above, now we are getting below error for a different project . can you please help with us if you have any workaround ?
I tried to exclude JSP files from scan but did not help much
build
14-Jul-2020 08:12:00
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project epdg-app-aggregator: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/webapp/UIComponentTag
Thank you Olivier, In my POM I do not use JSF dededency, Even I have tried to exclude the JSP file from sonar scan still I am seeing this issue. Can you please have a look if required I will share the log and pom file for further analysis .
Hello @sachidananda,
Just as a reminder, this is a community forum where you get free support in best effort. You should be more patient and chase less often.
I am just back from holidays and had a look at your POM. In this POM there several dependencies to some custom packages that are likely to contain JSF, the best evidence being that you exclude some javax libs afterwards (JSF faces being part of javax), and that is certainly the root cause. This is most probably not a SonarQube problem.
What I suggest you to do is to build your projects (without analyzing with SonarQube) and then search for presence of the embedded javax.faces package in built targets.
That should help you determine how to modify your POM to not include JSF
Olivier
@OlivierK Thank’s for your kind reply and appreciated for same, I was not aware of that you are on a vacation for a week, sorry to spam your mail box,As mentioned above I found the root cause and fixed it .I feel I should not bothered you . , In past I got reply and solution quickly that’s why my exceptions was more, I completely forget that I am getting the solution on free, Sorry for the inconvenience caused .
Have a great day & Again Thank you for your Kind support .
I am encountering the same problem with a project. To check if a dependency on JSF could be the cause, I checked the effective POM for the presence of javax.faces (running mvn help:effective-pom | grep javax.faces), but I couldn’t find any.
I should also mention that, apart from the “API incompatibility” error message, the detail is different in my case, seemingly having to do with the post-Java 9 module system (mentioned in the last, long line):
java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/jenkins/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
[ERROR] urls[1] = file:/home/jenkins/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/home/jenkins/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[4] = file:/home/jenkins/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
[ERROR] urls[5] = file:/home/jenkins/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @4ad1a276