Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jdk8u builds fail on build-marist-rhel79-s390x-1: java.lang.UnsupportedClassVersionError: org/apache/tools/ant/launch/Launcher : Unsupported major.minor version 52.0 #2777

Closed
andrew-m-leonard opened this issue Oct 6, 2022 · 14 comments

Comments

@andrew-m-leonard
Copy link
Contributor

Seems possibly a setup issue on node build-marist-rhel79-s390x-1
unclear what is causing:
https://ci.adoptopenjdk.net/view/Failing%20Temurin%20jobs/job/build-scripts/job/jobs/job/jdk8u/job/jdk8u-linux-s390x-temurin/154/

19:35:34  Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/tools/ant/launch/Launcher : Unsupported major.minor version 52.0
19:35:34  	at java.lang.ClassLoader.defineClass1(Native Method)
19:35:34  	at java.lang.ClassLoader.defineClass(ClassLoader.java:808)
19:35:34  	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
19:35:34  	at java.net.URLClassLoader.defineClass(URLClassLoader.java:443)
19:35:34  	at java.net.URLClassLoader.access$100(URLClassLoader.java:65)
19:35:34  	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
19:35:34  	at java.net.URLClassLoader$1.run(URLClassLoader.java:349)
19:35:34  	at java.security.AccessController.doPrivileged(Native Method)
19:35:34  	at java.net.URLClassLoader.findClass(URLClassLoader.java:348)
19:35:34  	at java.lang.ClassLoader.loadClass(ClassLoader.java:430)
19:35:34  	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:326)
19:35:34  	at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
19:35:34  	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

but it's repeatable.

I've disabled the node: https://ci.adoptopenjdk.net/computer/build-marist-rhel79-s390x-1/

@andrew-m-leonard
Copy link
Contributor Author

@Haroon-Khel fyi

@sxa
Copy link
Member

sxa commented Oct 6, 2022

Oh this has been happing for a while so not a new issue. Presumably when the new machines were provisioned a few weeks back.

@sxa sxa added the systemdown label Oct 6, 2022
@sxa
Copy link
Member

sxa commented Oct 6, 2022

If it's a class version issue it'll be because the java level it's trying to run with is lower than the version that the tool requirs. I guess this is running the CycloneDX stuff which has some specific java dependencies.

@andrew-m-leonard
Copy link
Contributor Author

Yeah, I suspect the apache ant java code is compiled with a later version than the JDK in the path/jdk_home ? Might worth comparing with node -2 ?

@Haroon-Khel
Copy link
Contributor

Haroon-Khel commented Oct 11, 2022

Alot of forums are pointing to using a higher jdk during compile time and a lower jdk during runtime. According to https://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0 the 52.0 suggests that whatever was compiled was compiled with java8, so it is being run by a java lower than that. The build-marist-rhel79 machines both have java7 installed, but theyre not in the PATH so I dont know why ant would use them

@Haroon-Khel
Copy link
Contributor

These Marist machines come with a lot of extra java binaries

[root@build-marist-rhel79-s390x-1 ~]# ls -la /usr/lib/jvm
total 16
drwxr-xr-x. 10 root root    4096 Sep 21 01:00 .
dr-xr-xr-x. 43 root root    8192 Sep 28 01:00 ..
lrwxrwxrwx.  1 root root      26 Sep 21 01:00 java -> /etc/alternatives/java_sdk
lrwxrwxrwx.  1 root root      32 Aug 18 10:00 java-1.7.0 -> /etc/alternatives/java_sdk_1.7.0
lrwxrwxrwx.  1 root root      40 Aug 18 10:00 java-1.7.0-openjdk -> /etc/alternatives/java_sdk_1.7.0_openjdk
drwxr-xr-x.  7 root root     137 Aug 18 10:00 java-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.s390x
lrwxrwxrwx.  1 root root      32 Sep 21 01:00 java-1.8.0 -> /etc/alternatives/java_sdk_1.8.0
lrwxrwxrwx.  1 root root      40 Sep 21 01:00 java-1.8.0-openjdk -> /etc/alternatives/java_sdk_1.8.0_openjdk
drwxr-xr-x.  6 root root     121 Sep 21 01:00 java-1.8.0-openjdk-1.8.0.345.b01-1.el7_9.s390x
lrwxrwxrwx.  1 root root      34 Sep 21 01:00 java-openjdk -> /etc/alternatives/java_sdk_openjdk
lrwxrwxrwx.  1 root root      26 Aug 19 04:22 jdk-10 -> /usr/lib/jvm/jdk-10.0.2+13
drwxr-xr-x. 10 root jenkins  119 Jul  3  2019 jdk-10.0.2+13
lrwxrwxrwx.  1 root root      26 Aug 19 04:22 jdk-11 -> /usr/lib/jvm/jdk-11.0.16+8
drwxr-xr-x.  9 root root     121 Jul 19 15:30 jdk-11.0.16+8
lrwxrwxrwx.  1 root root      25 Aug 19 04:23 jdk-15 -> /usr/lib/jvm/jdk-15.0.2+7
drwxr-xr-x.  9 root root     107 Jan 21  2021 jdk-15.0.2+7
lrwxrwxrwx.  1 root root      25 Aug 19 04:24 jdk-16 -> /usr/lib/jvm/jdk-16.0.2+7
drwxr-xr-x.  9 root root     121 Jul 22  2021 jdk-16.0.2+7
lrwxrwxrwx.  1 root root      25 Aug 19 04:25 jdk-17 -> /usr/lib/jvm/jdk-17.0.4+8
drwxr-xr-x.  9 root root     121 Jul 19 15:00 jdk-17.0.4+8
lrwxrwxrwx.  1 root root      25 Aug 19 04:21 jdk8 -> /usr/lib/jvm/jdk8u292-b10
drwxr-xr-x.  8 root root     176 Apr 20  2021 jdk8u292-b10
lrwxrwxrwx.  1 root root      21 Sep 21 01:00 jre -> /etc/alternatives/jre
lrwxrwxrwx.  1 root root      27 Aug 18 10:00 jre-1.7.0 -> /etc/alternatives/jre_1.7.0
lrwxrwxrwx.  1 root root      35 Aug 18 10:00 jre-1.7.0-openjdk -> /etc/alternatives/jre_1.7.0_openjdk
lrwxrwxrwx.  1 root root      53 Aug 18 10:00 jre-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.s390x -> java-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.s390x/jre
lrwxrwxrwx.  1 root root      27 Sep 21 01:00 jre-1.8.0 -> /etc/alternatives/jre_1.8.0
lrwxrwxrwx.  1 root root      35 Sep 21 01:00 jre-1.8.0-openjdk -> /etc/alternatives/jre_1.8.0_openjdk
lrwxrwxrwx.  1 root root      50 Sep 21 01:00 jre-1.8.0-openjdk-1.8.0.345.b01-1.el7_9.s390x -> java-1.8.0-openjdk-1.8.0.345.b01-1.el7_9.s390x/jre
lrwxrwxrwx.  1 root root      29 Sep 21 01:00 jre-openjdk -> /etc/alternatives/jre_openjdk

We only install 8 10 11 15 16 and 17 as part of our playbooks so I reckon the rest come from the provider

@sxa
Copy link
Member

sxa commented Oct 12, 2022

https://github.com/adoptium/temurin-build/blob/8e043e364ecac19f72fc592116de9386ed7ffd0d/sbin/build.sh#L676 is the code which defines which java is used for this section of the process. We need to understand why this is behaving differently on each system (Suggest manual re-runs with set -x added to parts of the process to aid debugging - since 52.0 is a Java 8 classfile version we're ending up with it being executed on java 7 somewhere - perhaps via the boot JDK setting?)

@Haroon-Khel
Copy link
Contributor

Haroon-Khel commented Apr 11, 2023

@sxa
Copy link
Member

sxa commented Apr 11, 2023

Point of note: Since adoptium/ci-jenkins-pipelines#642 (March 8th this year) we have been building in a docker container, so nothing on the host system should be affecting this any more.

@Haroon-Khel
Copy link
Contributor

The build itself passed so I am comfortable closing this issue. The smoke test failed due to

15:38:03  Run /home/jenkins/workspace/build-scripts/jobs/jdk8u/jdk8u-linux-s390x-temurin_SmokeTests/openjdkbinary/j2sdk-image/bin/java -version
15:38:03  =JAVA VERSION OUTPUT BEGIN=
15:38:03  Error: dl failure on line 894
15:38:03  Error: failed /home/jenkins/workspace/build-scripts/jobs/jdk8u/jdk8u-linux-s390x-temurin_SmokeTests/openjdkbinary/j2sdk-image/jre/lib/s390x/server/libjvm.so, because libffi.so.6: cannot open shared object file: No such file or directory

on test-docker-sles12-s390x-1 for which I'll raise a separate issue

@Haroon-Khel
Copy link
Contributor

Actually the above error concerns the built image, if im not mistaken? I'll reopen until I can confirm the error is unrelated to the build

@Haroon-Khel Haroon-Khel reopened this Apr 11, 2023
@sxa
Copy link
Member

sxa commented Apr 11, 2023

That machine is being decommissioned (it should already have been - I'm surprised it's even still live) as per #3022 so you should be able to run it somewhere else. Surprised we haven't hit that previously to be honest. Suggest running that on the other SLES12 box to verify that it works on there.

@Haroon-Khel Haroon-Khel self-assigned this Apr 11, 2023
@Haroon-Khel
Copy link
Contributor

The build passes, as does the smoke test, so I am closing this issue and opening a new one for the failing smoke test on test-docker-sles12-s390x-1 due to a missing library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants