UnsupportedClassVersionError on applying patch
search cancel

UnsupportedClassVersionError on applying patch


Article ID: 259954


Updated On:


CA API Gateway


When applying v10.1 CR02 patch, I encountered java.lang.UnsupportedClassVersionError.

Command line and Result:

# /opt/SecureSpan/Controller/bin/patch.sh install Layer7_API_Gateway_v10.1.00.14326-CR02 

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.l7tech.common.io.CertUtils (file:/opt/SecureSpan/Controller/lib/layer7-common- to constructor sun.security.ec.ECPublicKeyImpl(byte[])
WARNING: Please consider reporting this to the maintainers of com.l7tech.common.io.CertUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/l7tech/server/processcontroller/patching/builder/PatchMain has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
Patch exit code: 1
Patch ID Layer7_API_Gateway_v10.1.00.14326-CR02 (Upgrades the Layer7 API Gateway Software to version This patch requires a reboot of the Layer7 Gateway Appliance after installation.) is ERROR, last modified on 2023-02-14T02:16:57-0500
There were errors during the patch operation. See sspc logs in /opt/SecureSpan/Controller/var/logs for details.


API Gateway 10.1 Software


The error was caused by JDK misconfiguration.

Follow Step #8 from the below documentation: "Install Upgrade Files for RHEL/CentOS". One for Gateway main menu, and another for the host.properties file.

8. (Optional) If a JDK update was performed, you must configure the correct Java path. Depending on your Gateway upgrade path, complete one of the following sub procedures:

o If you are upgrading from the baseline or a previous cumulative release to the latest cumulative release (e.g, version 10.1 GA to version 10.1 CR1), configure the path via the Gateway main menu:

- Access the Gateway main menu.
- Select option 2 (Configure the Layer7 API Gateway) and then option 1 (Set Up the Gateway Java VM).
- Set the Java VM Path to the current path of JAVA_HOME.
- Exit the main menu and then access a command prompt on the host machine.

- Open /opt/SecureSpan/Controller/etc/host.properties in a text editor.
- Set Host.jre to the current path of JAVA_HOME.

Additional Information

Install Upgrade Files for RHEL/CentOS