[JIRA] (JENKINS-61105) 2.204.3 rc fails to open folder in Java 8, throws class not found exception

24 views
Skip to first unread message

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 16, 2020, 10:14:02 AM2/16/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Jenkins / Bug JENKINS-61105
2.204.3 rc fails to open folder in Java 8, throws class not found exception
Change By: Mark Waite
Summary: 2.204.3 rc fails to open folder in Java 8 , throws class not found exception
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 16, 2020, 10:15:02 AM2/16/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
Environment: Jenkins 2.204.3 release candidate as included in my docker-lfs image on the lts-with-plugins-rc branch
Running Java 8 shows the failure.
Running Java 11 does not show the failure.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 16, 2020, 6:50:04 PM2/16/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Jenkins 2.204.3 release candidate build fails to open one or more folders in my test docker image when run with Java 8.  It reports MethodNotFoundException for a CharBuffer rewind() method.  It does not report that error when run with Java 11.  Jenkins 2.220 does not report that error.  Jenkins 2.204.2 does not report that error.

The manifest included in the [2.204.3 rc jenkins.war file|http://mirrors.jenkins-ci.org/war-stable-rc/2.204.3/jenkins.war] is:

{noformat}
Manifest-Version: 1.0
Created-By: Maven Archiver 3.4.0
Build-Jdk-Spec: 11
Main-Class: Main
Hudson-Version: 1.395
Implementation-Version: 2.204.3-SNAPSHOT
Jenkins-Version: 2.204.3-SNAPSHOT
Remoting-Embedded-Version: 3.36.1
Remoting-Minimum-Supported-Version: 3.14
{noformat}

The manifest included in the 2.204.2 jenkins.war file is:

{noformat}
Manifest-Version: 1.0
Hudson-Version: 1.395
Remoting-Minimum-Supported-Version: 3.14
Implementation-Version: 2.204.2
Remoting-Embedded-Version: 3.36.1
Jenkins-Version: 2.204.2
Build-Jdk-Spec: 1.8
Created-By: Maven Archiver 3.4.0
Main-Class: Main
{noformat}

Notice the difference in *Build-Jdk-Spec*.

See the [google groups message|https://groups.google.com/d/msg/jenkinsci-dev/GbkLba9Mm-g/2NUG7-RMFwAJ] for the detailed analysis.

# Install git large file support on your Linux computer (or download from git-lfs.github.com)
# Iniitalize git lfs with
{noformat}
$ git lfs install
Git LFS initialized.
{noformat}
# Clone my docker-lfs repository
{noformat}
$ git clone https://github.com/MarkEWaite/docker-lfs
Cloning into 'docker-lfs'...
Resolving deltas: 100% (12717/12717), done.
{noformat}
# Change to the docker-lfs directory
{noformat}
$ cd docker-lfs
{noformat}
# Checkout the lts-with-plugins-rc branch
{noformat}
$ git checkout -b lts-with-plugins-rc -t origin/lts-with-plugins-rc
Filtering content: 100% (190/190), 244.87 MiB | 5.36 MiB/s, done.
Branch 'lts-with-plugins-rc' set up to track remote branch 'lts-with-plugins-rc' from 'origin'.
Switched to a new branch 'lts-with-plugins-rc'
{noformat}
# Build the docker image
{noformat}
$ docker build -f Dockerfile -t markewaite/lts-rc:2.204.3 .
{noformat}
# Run the docker image
{noformat}
$ docker run --rm -i -e JENKINS_ADVERTISED_HOSTNAME=`hostname` \
-e START_QUIET=True -p 8080:8080 -t markewaite/lts-rc:2.204.3
{noformat}
# Connect to the running image with a web browser
{noformat}
$ python -m webbrowser http://$(hostname):8080/
{noformat}
# Open each of the folders at the root of that Jenkins server.  One of them will fail to an Oops screen (at least does on the 3 machines where I've tested)

Some of the folders fail to open when I click them and I receive the following stack track in an "Oops" page on one instance:

{noformat}
org.apache.commons.jelly.JellyTagException: jar:file:/var/jenkins_home/war/WEB-INF/lib/jenkins-core-2.204.3-SNAPSHOT.jar!/hudson/model/View/index.jelly:42:43: <st:include> org.apache.commons.jelly.JellyTagException: jar:file:/var/jenkins_home/war/WEB-INF/lib/jenkins-core-2.204.3-SNAPSHOT.jar!/lib/hudson/projectView.jelly:84:48: <j:forEach> java.nio.CharBuffer.rewind()Ljava/nio/CharBuffer;
at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:726)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:281)
{noformat}

In the other test instance, the message appears in the console log and does not appear in the Jenkins Oops page.  In the console log, it reports:

{noformat}
2020-02-15 16:37:04.540+0000 [id=164374]        INFO    j.b.MultiBranchProject$BranchIndexing#run: Bugs-Pipeline-Checks/jenkins-bugs-multibranch-pipeline-bitbucket #20200215.093700 branch indexing action completed: SUCCESS in 3.6 sec
2020-02-15 16:39:26.329+0000 [id=39]    SEVERE  hudson.triggers.SafeTimerTask#run: Timer task com.cloudbees.jenkins.Cleaner@7ed56677 failed
java.lang.NoSuchMethodError: java.nio.CharBuffer.rewind()Ljava/nio/CharBuffer;
        at hudson.Util.rawEncode(Util.java:886)
        at hudson.model.AbstractItem.getShortUrl(AbstractItem.java:576)
        at hudson.model.AbstractItem.getUrl(AbstractItem.java:537)
{noformat}

I don't know why there is a difference in behavior.  I don't know if the issue is related to something in my local environment, the Docker image definition that I'm using, or something completely different.

The folders which fail to open are different in the two instances, but the stack traces seem to consistently be associated with CharBuffer.rewind().

Later in the stack trace, it reports:

{noformat}
Caused by: java.lang.NoSuchMethodError: java.nio.CharBuffer.rewind()Ljava/nio/CharBuffer;
at hudson.Util.rawEncode(Util.java:886)
{noformat}

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 16, 2020, 7:12:04 PM2/16/20
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Jenkins 2.204.3 release candidate build fails to open one or more folders in my test docker image when run with Java 8.  It reports MethodNotFoundException for a CharBuffer rewind() method.  It does not report that error when run with Java 11.  Jenkins 2.220 does not report that error.  Jenkins 2.204.2 does not report that error.

The manifest included in the [2.204.3 rc jenkins.war file|http://mirrors.jenkins-ci.org/war-stable-rc/2.204.3/jenkins.war] is:

{noformat}
Manifest-Version: 1.0
Build-Jdk-Spec: 11
Created-By: Maven Archiver 3.4.0
Build-Jdk-Spec: 11
Main-Class: Main
Hudson-Version: 1.395
Implementation-Version: 2.204.3-SNAPSHOT
Jenkins-Version: 2.204.3-SNAPSHOT
Main-Class: Main
Remoting-Embedded-Version: 3.36.1
Remoting-Minimum-Supported-Version: 3.14
{noformat}

The manifest included in the 2.204.2 jenkins.war file is:

{noformat}
Manifest-Version: 1.0
Hudson Build - Version Jdk-Spec : 1. 395 8
Remoting Created - Minimum By: Maven Archiver 3.4.0
Hudson
- Supported- Version: 3 1 . 14 395
Implementation-Version: 2.204.2
Remoting-Embedded-Version: 3.36.1
Jenkins-Version: 2.204.2
Build Main - Jdk-Spec Class : 1.8 Main
Created Remoting - By Embedded-Version : Maven Archiver 3. 4 36 . 0 1
Main Remoting - Class Minimum-Supported-Version : Main 3.14

ogondza@gmail.com (JIRA)

unread,
Feb 17, 2020, 2:49:02 AM2/17/20
to jenkinsc...@googlegroups.com
Oliver Gondža commented on Bug JENKINS-61105
 
Re: 2.204.3 rc fails to open folder in Java 8, throws class not found exception

Checking back, I have build this RC using openjdk 11.0.6 (unlike all previous ones). This appears to be common problem when built on 9+ and run on older release. The thing is, the return types of some overridden methods in JDK got more specific types than its superclasses have, which is binary-incompatible as the synthetic bridge methods are missing in older JDK runtime.

I will try to confirm and do a re-spin. Long term fix would be to incorporate[1] so we can safely build on newer JDK while guaranteeing the compatibility for the older one.

[1] http://openjdk.java.net/jeps/247

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

unread,
Feb 17, 2020, 4:29:03 AM2/17/20
to jenkinsc...@googlegroups.com

That's strange. We should have all the target JDK flags (--release) in place for Jenkins POMs. So builds by JDK11 should e compatible with JDK8... but apparently they are not.

We will need to apply patches later, but for now it is better to just builds with JDK8

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

unread,
Feb 17, 2020, 4:29:04 AM2/17/20
to jenkinsc...@googlegroups.com

ogondza@gmail.com (JIRA)

unread,
Feb 17, 2020, 6:50:03 AM2/17/20
to jenkinsc...@googlegroups.com
Oliver Gondža commented on Bug JENKINS-61105
 
Re: 2.204.3 rc fails to open folder in Java 8, throws class not found exception

I have squeezed in some test-ignoring fixes, verified all tests are passing now and will re-publish the RC.

Oleg Nenashev, this is the exact command that is being run: https://github.com/jenkins-infra/backend-commit-history-parser/blob/aab0dfe7f40c316058ca39eeae148efcddabf5e5/bin/publish-lts-rc#L17. Will have to dig deeper on why it does not pick up the --release flag.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 17, 2020, 6:52:04 AM2/17/20
to jenkinsc...@googlegroups.com
Mark Waite started work on Bug JENKINS-61105
 
Change By: Mark Waite
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Feb 17, 2020, 8:36:03 AM2/17/20
to jenkinsc...@googlegroups.com

We should have all the target JDK flags (--release) in place for Jenkins POMs.

I could not find such a flag in jenkinsci/jenkins nor jenkinsci/pom. What is it supposed to look like?

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

unread,
Feb 17, 2020, 8:52:04 AM2/17/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 17, 2020, 9:58:02 AM2/17/20
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Fixed
 

Fixed in the 2.204.3 rc respin that was created on Feb 17, 2020.

Change By: Mark Waite
Status: In Progress Closed
Resolution: Fixed

ogondza@gmail.com (JIRA)

unread,
Mar 19, 2020, 5:53:05 AM3/19/20
to jenkinsc...@googlegroups.com
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
Mar 23, 2020, 4:48:02 AM3/23/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages