wnehdi opened a new issue, #1653:
URL: https://github.com/apache/camel-karavan/issues/1653

   ### Describe the bug
   
   Hello,
   
   Apache Camel Karavan 4.22.1 fails to start on Kubernetes with an 
`UnsupportedClassVersionError`.
   
   **Environment**
   - Karavan: 4.22.1
   - Deployment: Kubernetes, managed through Rancher
   - Image: `ghcr.io/apache/camel-karavan:4.22.1`, pulled through a Harbor 
proxy cache
   
   **Steps to reproduce**
   1. Deploy the Karavan 4.22.1 image with the required configuration.
   2. Start the container.
   3. Check the application logs.
   
   **Actual behavior**
   
   The application fails during startup:
   
   ```text
   java.lang.UnsupportedClassVersionError:
   org/apache/camel/karavan/service/NotificationService
   has been compiled by a more recent version of the Java Runtime
   (class file version 69.0), this version of the Java Runtime
   only recognizes class file versions up to 65.0
   ```
   
   **Expected behavior**
   
   The published container image should include a Java runtime compatible with 
the packaged application.
   
   **Identified mismatch**
   
   In the `4.22.1` source tag:
   
   `karavan-app/pom.xml`:
   ```xml
   <maven.compiler.source>25</maven.compiler.source>
   <maven.compiler.release>25</maven.compiler.release>
   ```
   
   `karavan-app/src/main/docker/Dockerfile`:
   ```dockerfile
   FROM eclipse-temurin:21-jdk
   ```
   
   Class file version **69** corresponds to Java **25**, while version **65** 
corresponds to Java **21**.
   
   **Tested workaround**
   
   I used an init container to copy `/opt/app/karavan.jar` from the Karavan 
image into a shared volume, then executed the same JAR in a container based on 
`eclipse-temurin:25-jdk`.
   
   The application started successfully with this workaround.
   
   **Suggested fix**
   
   Align the container runtime with the application's compilation target, for 
example by updating the Dockerfile base image to:
   
   ```dockerfile
   FROM eclipse-temurin:25-jdk
   ```
   
   Please also consider adding a startup smoke test for the built image to 
detect this mismatch before publication.
   
   Thank you.
   
   ### Steps to reproduce the behavior
   
   
   ...
   
   ### Variant
   
   Web Application
   
   ### Container Management (if applicable)
   
   Kubernetes
   
   ### Operating System (if applicable)
   
   Linux
   
   ### Version
   
   4.22.1
   
   ### Relevant log output
   
   ```shell
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to