infrastructure icon indicating copy to clipboard operation
infrastructure copied to clipboard

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

Open andrew-m-leonard opened this issue 3 years ago • 7 comments

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 avatar Oct 06 '22 15:10 andrew-m-leonard

@Haroon-Khel fyi

andrew-m-leonard avatar Oct 06 '22 15:10 andrew-m-leonard

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 avatar Oct 06 '22 16:10 sxa

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.

sxa avatar Oct 06 '22 16:10 sxa

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 ?

andrew-m-leonard avatar Oct 06 '22 19:10 andrew-m-leonard

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 avatar Oct 11 '22 16:10 Haroon-Khel

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

Haroon-Khel avatar Oct 11 '22 16:10 Haroon-Khel

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?)

sxa avatar Oct 12 '22 10:10 sxa

Fresh build on build-marist-rhel79-s390x-1 https://ci.adoptium.net/view/Failing%20Temurin%20jobs/job/build-scripts/job/jobs/job/jdk8u/job/jdk8u-linux-s390x-temurin/262/console

Haroon-Khel avatar Apr 11 '23 13:04 Haroon-Khel

Point of note: Since https://github.com/adoptium/ci-jenkins-pipelines/pull/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.

sxa avatar Apr 11 '23 14:04 sxa

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 avatar Apr 11 '23 15:04 Haroon-Khel

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 avatar Apr 11 '23 15:04 Haroon-Khel

That machine is being decommissioned (it should already have been - I'm surprised it's even still live) as per https://github.com/adoptium/infrastructure/pull/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.

sxa avatar Apr 11 '23 17:04 sxa

New build https://ci.adoptium.net/view/Failing%20Temurin%20jobs/job/build-scripts/job/jobs/job/jdk8u/job/jdk8u-linux-s390x-temurin/263/console

Haroon-Khel avatar Apr 12 '23 15:04 Haroon-Khel

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

Haroon-Khel avatar Apr 13 '23 11:04 Haroon-Khel