[JIRA] (JENKINS-58279) Sonar gerrit plugin fails with ClassCastException on java 11

20 views
Skip to first unread message

peter.kristensson@qmatic.com (JIRA)

unread,
Jul 1, 2019, 4:52:03 AM7/1/19
to jenkinsc...@googlegroups.com
Peter Kristensson created an issue
 
Jenkins / Bug JENKINS-58279
Sonar gerrit plugin fails with ClassCastException on java 11
Issue Type: Bug Bug
Assignee: Tatiana Didik
Attachments: suggested_fix.patch
Components: sonar-gerrit-plugin
Created: 2019-07-01 08:51
Environment: Jenkins: 2.176.1 (docker image jenkins/jenkins:lts-jdk11)
Sonar-gerrit plugin: 2.3
Gerrit: 2.15.7
Sonarqube: 7.6
Priority: Major Major
Reporter: Peter Kristensson

We run jenkins in a docker container and integrate to a gerrit server using the gerrit-trigger and sonar-gerrit plugins.
Recently we updated our jenkins server from java 8 to java 11, and encountered an error with the sonar-gerrit plugin.

It fails in the post-build step due to a ClassCastException.
The error logged is this:

Recording test results
Getting Sonar Report from: /var/jenkins_home/workspace/cloud-visits/build/sonar/sonar-report.json
Report has loaded and contains 2 issues
ERROR: Build step failed with exception
java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class [Ljava.lang.String; ([Ljava.lang.Object; and [Ljava.lang.String; are in module java.base of loader 'bootstrap')
at org.jenkinsci.plugins.sonargerrit.SonarToGerritPublisher.perform(SonarToGerritPublisher.java:112)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1843)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Post SonarQube issues as Gerrit comments' marked build as failure

We did some digging around and this is a related JDK change that changes the return type of toArray():
https://bugs.openjdk.java.net/browse/JDK-8176893

Attached is a patch file that we have used to make a local build of the plugin that works fine in our environment.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

o.v.nenashev@gmail.com (JIRA)

unread,
Jul 2, 2019, 8:43:02 PM7/2/19
to jenkinsc...@googlegroups.com
Oleg Nenashev updated an issue
Change By: Oleg Nenashev
Labels: java11 java11-compatibility

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Jul 3, 2019, 4:19:02 AM7/3/19
to jenkinsc...@googlegroups.com
Baptiste Mathus updated an issue
Change By: Baptiste Mathus
Labels: java11 java11-compatibility triaged

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Jul 3, 2019, 4:20:02 AM7/3/19
to jenkinsc...@googlegroups.com

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Jul 3, 2019, 4:22:02 AM7/3/19
to jenkinsc...@googlegroups.com
Baptiste Mathus commented on Bug JENKINS-58279
 
Re: Sonar gerrit plugin fails with ClassCastException on java 11

Peter Kristensson hello! I think if you want to move this forward, it would be even easier for the maintainer if a PR can be submitted against https://github.com/jenkinsci/sonar-gerrit-plugin directly.

We can help you to do that if you are willing to help.

Thanks a lot for the fix!

peter.kristensson@qmatic.com (JIRA)

unread,
Jul 3, 2019, 4:45:02 AM7/3/19
to jenkinsc...@googlegroups.com

Baptiste Mathus Hi, I can certainly do a pull request on that repository. My github userid is "kripe".

//Peter

egutierrez@cloudbees.com (JIRA)

unread,
Jul 11, 2019, 4:00:03 AM7/11/19
to jenkinsc...@googlegroups.com

Peter Kristensson I have not seen any PR on the repository. Can we help you in any way?

 

peter.kristensson@qmatic.com (JIRA)

unread,
Jul 15, 2019, 5:19:02 AM7/15/19
to jenkinsc...@googlegroups.com

adrien.lecharpentier@gmail.com (JIRA)

unread,
Jul 26, 2019, 4:30:03 AM7/26/19
to jenkinsc...@googlegroups.com

adrien.lecharpentier@gmail.com (JIRA)

unread,
Jul 26, 2019, 4:30:03 AM7/26/19
to jenkinsc...@googlegroups.com
Adrien Lecharpentier started work on Bug JENKINS-58279
 
Change By: Adrien Lecharpentier
Status: Open In Progress

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Jul 31, 2019, 4:30:02 AM7/31/19
to jenkinsc...@googlegroups.com
Baptiste Mathus updated an issue
Change By: Baptiste Mathus
Labels: java11 java11-compatibility triaged
Reply all
Reply to author
Forward
0 new messages