Task 1: Upgrade Docker Base Images#194
Task 1: Upgrade Docker Base Images#194devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
Co-Authored-By: Wes Convery <2wconvery@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| @@ -1,4 +1,4 @@ | |||
| FROM openjdk:8u171-jre-alpine | |||
| FROM eclipse-temurin:17-jre-alpine | |||
There was a problem hiding this comment.
🔴 Java 17 runtime is incompatible with Spring Boot 2.0.3, causing startup crash
The Dockerfile upgrades the JRE from OpenJDK 8 to Eclipse Temurin 17, but the application uses Spring Boot 2.0.3.RELEASE (gradle.properties:6). Spring Boot 2.0.3 uses Spring Framework 5.0.x, which relies on reflective access to JDK internals (e.g., setAccessible() on internal classes). Java 17 enforces strong encapsulation by default (--illegal-access=deny since Java 16), which will cause the application to crash at startup with InaccessibleObjectException. Spring Boot only officially supports Java 17 starting from version 2.5.5+/2.6.x. The JAVA_OPTS in docker-compose.yml:25 is set to -Xmx192m with no --add-opens flags to work around this. The fix requires either upgrading Spring Boot to a Java 17-compatible version (e.g., 2.7.x or 3.x), adding the necessary --add-opens JVM flags, or reverting to a compatible JRE (8 or 11).
Prompt for agents
The Dockerfile has been changed to use eclipse-temurin:17-jre-alpine, but the application is built with Spring Boot 2.0.3.RELEASE (defined in gradle.properties). Spring Boot 2.0.3 does not support Java 17 — it requires Java 8-10. Java 17 strongly encapsulates JDK internals, breaking the deep reflection that Spring Framework 5.0.x and Hibernate (used via spring-boot-starter-data-jpa) rely on.
The application will crash at startup with InaccessibleObjectException errors.
Possible fixes:
1. Keep using a Java 8 or 11 base image (e.g., eclipse-temurin:11-jre-alpine) which is compatible with Spring Boot 2.0.3.
2. Upgrade Spring Boot to a version that supports Java 17 (at minimum 2.5.5, preferably 2.7.x or 3.x), which is a much larger change requiring updates to gradle.properties, build.gradle (sourceCompatibility/targetCompatibility), and potentially dependency/API changes.
3. As a workaround, add --add-opens flags to JAVA_OPTS in docker-compose.yml (e.g., --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED, etc.), though this is fragile and not recommended for production.
Relevant files: gradle.properties (springBootVersion), build.gradle (source/target compatibility set to 1.8), docker-compose.yml (JAVA_OPTS), ftgo-application/Dockerfile.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Good catch — Spring Boot 2.0.3 (gradle.properties:6) with sourceCompatibility = '1.8' (build.gradle:21) is indeed not officially compatible with Java 17 due to strong encapsulation of JDK internals.
This change was explicitly requested as-is. A follow-up task may be needed to either:
- Upgrade Spring Boot to 2.7.x+ or 3.x for full Java 17 support
- Add
--add-opensflags toJAVA_OPTSas a workaround - Use
eclipse-temurin:11-jre-alpineas a safer intermediate step
Summary
Upgrades the Docker base images for both the Java application and MySQL database to modern, supported versions:
openjdk:8u171-jre-alpine→eclipse-temurin:17-jre-alpine(Java 8 → Java 17, Eclipse Temurin is the community-supported successor to Oracle OpenJDK Docker images)mysql:5.7.13→mysql:8.0(MySQL 5.7 is EOL as of October 2023)command: --default-authentication-plugin=mysql_native_passwordto the MySQL service for backward compatibility with clients expecting the legacy authentication methodcom.mysql.jdbc.Drivertocom.mysql.cj.jdbc.Driver(the old class is deprecated in MySQL Connector/J 8.x)Review & Testing Checklist for Human
docker-compose upbuilds and starts both services successfullyNotes
mysql_native_passwordauthentication plugin is set explicitly because MySQL 8.0 defaults tocaching_sha2_password, which may cause compatibility issues with older JDBC drivers.Link to Devin session: https://app.devin.ai/sessions/30e305beec4d4a92b0e44423d58a81ef
Requested by: @WesternConcrete
Devin Review