Skip to content

Upgrade to Java 17 and Spring Boot 3.5.16 - #75

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1786547874-java17-upgrade
Open

devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1786547874-java17-upgrade

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 12, 2026

Copy link
Copy Markdown

Summary

Java 8 → 17, Spring Boot 2.0.2.RELEASE3.5.16 (Jakarta EE 10, Tomcat 10.1), plus build tooling that can actually run on a 17 JDK: Gradle wrapper 4.68.14.5, Maven wrapper 3.3.93.9.16. No javax.* imports existed, so the Jakarta switch is a no-op for the source.

Non-obvious bits beyond the version bumps:

  • pom.xml had <packaging>pom</packaging>, so spring-boot-maven-plugin:repackage never produced a runnable artifact. Changed to jar; ./mvnw clean package now yields a bootable target/gs-spring-boot-0.1.0.jar.
  • build.gradle only declared starter-web + junit while the code uses JdbcTemplate and H2, so a Gradle build of Application.java could not have compiled. Added starter-jdbc, h2, and the properties migrator so the Gradle and Maven builds are equivalent. Also compile/testCompileimplementation/testImplementation, bootJar.baseName/versionarchiveBaseName/archiveVersion (removed in Gradle 8), and Java version via a toolchain rather than the sourceCompatibility project property (removed in Gradle 9).
  • Two source changes were forced by Spring Framework 6, not by Java 17:
    • jdbcTemplate.query(sql, Object[] args, RowMapper) was removed in 6.0 → varargs form query(sql, rowMapper, "Josh").
    • The startup call to http://gturnquist-quoters.cfapps.io/api/random (a domain that no longer resolves) is hit twice — in main and in the CommandLineRunner bean — and under Boot 3 an exception there fails the whole application run. Both call sites now go through one logRandomQuote helper that catches RestClientException and warns instead of aborting startup.
  • Deleted the stale gs-spring-boot.iml (pinned JDK_1_8 and 2.0.2 dependency versions) and gitignored *.iml, target/, build/, .gradle/; committed build output was previously tracked under target/.
  • application.properties contains only a commented-out server.port, so nothing to migrate.

Verified locally on JDK 17: mvn clean package and ./gradlew build both succeed, the boot jar starts on Tomcat 10.1, GET / returns 200, GET /topic returns the topic JSON, the H2 customer insert/query runs, and the unreachable quote endpoint only logs a warning.

Link to Devin session: https://app.devin.ai/sessions/de65fc6627bf43f2b4a8d92ba9239d18
Requested by: @joebensoncog97


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

…tooling

Co-Authored-By: Joe Benson <joe.benson@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Joe Benson <joe.benson@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

Runtime verification — Java 17 / Spring Boot 3.5.16 upgrade

Built and ran the boot jar on JDK 17 (openjdk 17.0.19) and exercised every controller route end-to-end.

End-to-end run

REST API — all routes verified against the running jar
Route Result
GET / / GET /?name=Devin {"id":4,"content":"Hello, World!"} / Hello, Devin!, counter increments
GET /topic ✅ 3 topics
POST /topic ✅ 200, kotlin appears in list
PUT /topic/kotlin ✅ 200, subjectNameKotlin Updated
DELETE /topic/kotlin ✅ 200, list back to 3
GET /topic/minimum/length/4 ✅ spring + javascript only
GET /topic/sort ✅ java, javascript, spring
GET /datetime, /topic/string/operation, /topic/file/operation ✅ all render real data

Full CRUD round trip (POST → PUT → DELETE) verified in the browser:

GET /topic after POST — kotlin added

GET /topic/kotlin after PUT — Kotlin Updated

Startup: Tomcat 10.1.55, H2 insert/query, quote URL WARN-only
o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.55]
hello.Application : Started Application in 1.14 seconds
hello.Application : WARN Unable to fetch a quote from http://gturnquist-quoters.cfapps.io/api/random: ...
hello.Application : Inserting customer record for John Woo / Jeff Dean / Josh Bloch / Josh Long
hello.Application : Querying for customer records where first_name = 'Josh':
hello.Application : Customer{id=3, firstName='Josh', lastName='Bloch'}
hello.Application : Customer{id=4, firstName='Josh', lastName='Long'}

The Josh rows confirm the new varargs JdbcTemplate.query(...) form works on Spring 6, and the unreachable quote URL only WARNs rather than failing startup.

Adversarial input — no Spring 6 migration fallout
Case Status
POST /topic malformed JSON {bad 400 ✅
POST /topic no body 400 ✅
GET /topic/minimum/length/abc 400 ✅
GET /nope 404 ✅
GET /topic/doesnotexist 500 ⚠️

The single 500 is java.util.NoSuchElementException: No value present at TopicService.getTopicWithId (Optional.get() without a presence check) — pre-existing behaviour, unrelated to this upgrade; no javax.* or removed-API references anywhere in the trace. Worth a follow-up fix (return 404) but not a blocker for this PR.

500 on unknown topic id

Builds
  • mvn clean package → BUILD SUCCESS, target/gs-spring-boot-0.1.0.jar (boot-repackaged) ✅
  • ./gradlew clean build → BUILD SUCCESSFUL, build/libs/gs-spring-boot-0.1.0.jar ✅ (needed a Maven Central mirror init script because repo1.maven.org rate-limits the test box — environment issue, no code change made)
  • ./mvnw could not be verified: downloading the 3.9.16 distribution returned HTTP 429 from repo1.maven.org on this box. The wrapper script was also non-executable in git; fixed in this PR (chmod +x mvnw).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants