Puppetserver service fails to start with error (UnsupportedClassVersionError) at java.lang.ClassLoader/defineClass1 on Red Hat Satellite 6.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.16
  • Red Hat Capsule 6.16

Issue

  • Puppetserver service fails to start on Red Hat Satellite with below error:

    Starting puppetserver Service 2025-02-21T09:50:07.548032+01:00 satellite.example.com puppetserver[1343108]: Execution error (UnsupportedClassVersionError) at java.lang.ClassLoader/defineClass1 (ClassLoader.java:-2).  2025-02-21T09:50:07.548032+01:00 satellite.example.com puppetserver[1343108]: com/puppetlabs/puppetserver/EnvironmentRegistry 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
    

Resolution

  • Perform below command on Red Hat Satellite server and set the Java version to 17:

       # alternatives --config java
    
       There are 3 programs which provide 'java'.
    
       Selection    Command
    
        *  1           java-17-openjdk.x86_64 (/usr/lib/jvm/java-17-openjdk-17.0.14.0.7-2.el8.x86_64/bin/java)
           2           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.25.0.9-3.el8.x86_64/bin/java)
         + 3           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.442.b06- 
                       2.el8.x86_64/jre/bin/java)
           Enter to keep the current selection[+], or type selection number: 
    
  • Select Option1 and configure java 17.

  • Restart puppetserver service on Satellite server:

    # systemctl restart puppetserver
    

For more KB articles/solutions related to Red Hat Satellite 6.x Puppet Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Puppet Issues

Prevention
This issue occurs in environments where the Puppet Server is running but is not under the control of the Satellite installer. To ensure your Puppet Server is properly managed by the installer and that its configuration is automatically updated during future upgrades, we recommend running the following command to enable the Puppet feature on the affected Satellite or Capsule Server.

Run the satellite-installer command to enable the relevant Puppet features:

# satellite-installer \
--enable-puppet \
--foreman-proxy-puppet true \
--foreman-proxy-puppetca true \
--puppet-server true

Root Cause

  • Tomcat is using java 17 but the current configuration of java on Red Hat Satellite is auto and the link points to /usr/lib/jvm/java-1.8.0 i.e it is using java 8:

       # ps -aux | grep tomcat | head
    tomcat      1865 19.8  2.5 15667472 1741052 ?    -    09:55   2:09 /usr/lib/jvm/jre-17/bin/java -Xms1024m -Xmx4096m -Dcom.redhat.fips=false -Djava.security.auth.login.config=/usr/share/tomcat/conf/login.config -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar: -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start
    tomcat         -  0.0    -      -     - -        Ssl  09:55   0:00 -
    
     # alternatives --config java head
    java - status is auto.
     link currently points to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.442.b06-2.el8.x86_64/jre/bin/java
    
  • From the error puppetlabs/puppetserver/EnvironmentRegistry has been compiled by a more recent version of the Java Runtime (class file version 55.0), it can be confirmed puppetserver is compiling with version 55.0 i.e java 11 but the current configuration of java on Red Hat Satellite is using java 8.

  • Puppet Server versions are tested against the following versions of Java:

    Puppet Server	        Java
    8.y and later	        11, 17
    
  • Tested versions for Puppet Server is 11 and 17 on RHEL 8.y and above versions and Tomcat is using java 17 but the current configuration of java on Red Hat Satellite is java 8 hence it is required to configure the Satellite to use java 17.

Diagnostic Steps

  • Below error messages is captured in /var/log/messages :

    2025-02-21T09:50:02.740073+01:00 satellite.example.com systemd[1]: Starting puppetserver Service...
    2025-02-21T09:50:07.548032+01:00 satellite.example.com puppetserver[1343108]: Execution error (UnsupportedClassVersionError) at java.lang.ClassLoader/defineClass1 (ClassLoader.java:-2).
    2025-02-21T09:50:07.548032+01:00 satellite.example.com puppetserver[1343108]: com/puppetlabs/puppetserver/EnvironmentRegistry 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
    2025-02-21T09:50:07.548032+01:00 satellite.example.com puppetserver[1343108]: Full report at:
    2025-02-21T09:50:07.548032+01:00 satellite.example.com puppetserver[1343108]: /tmp/clojure-5471482928170817653.edn
    2025-02-21T09:50:07.901166+01:00 satellite.example.com puppetserver[1343019]: Background process 1343108 exited before start had completed
    
SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.