Skip to content

feature: migrate BankWS to Spring Boot 3.3.13 / Java 21 (jakarta namespace + CVE-retiring dependency upgrades) - #8

Open
vanessasalas-cog wants to merge 2 commits into
masterfrom
devin/1787596428-springboot3-java21
Open

vanessasalas-cog wants to merge 2 commits into
masterfrom
devin/1787596428-springboot3-java21

Conversation

@vanessasalas-cog

@vanessasalas-cog vanessasalas-cog commented Aug 24, 2026 •

Copy link
Copy Markdown

Summary

Upgrades BankWS from Spring Boot 2.3.0.RELEASE / Java 11 to Spring Boot 3.3.13 / Java 21, including the full javax.* → jakarta.* namespace migration and the dependency jumps the framework upgrade forces (Hibernate 5.4 → 6.5, Tomcat 9 → 10.1, Liquibase 3.8 → 4.27, H2 1.4 → 2.2, JAX-WS RI 2.3 → 4.0). Runtime behaviour is unchanged: the SOAP response for getTrasactionsForClient("rshtishi") is byte-identical before and after the migration (verified by running both revisions side by side against http://localhost:8888/baws).

Before / after

before after
Spring Boot 2.3.0.RELEASE 3.3.13
Java 11 21
Spring Framework 5.2.6.RELEASE 6.1.21
Hibernate ORM 5.4.15.Final 6.5.3.Final
Tomcat (embedded) 9.0.35 10.1.55 (pinned ahead of Boot's managed 10.1.42)
JAX-WS com.sun.xml.ws:jaxws-ri:2.3.0 (pom, javax) com.sun.xml.ws:jaxws-rt:4.0.3 (jakarta)
Liquibase 3.8.9 4.27.0
H2 1.4.200 2.2.224
Jackson 2.11.0 2.17.3
SnakeYAML 1.26 2.2
Logback 1.2.3 1.5.18
Lombok 1.18.12 (pinned) 1.18.38 (Boot-managed)
Tests 6 passing (Java 11) 7 passing (Java 21)

Non-obvious changes

1. Enum column mapping broke under Hibernate 6. Transaction.actionType maps to an H2 native ENUM column whose values are 'Deposit'/'Withdraw', while the Java constants are DEPOSIT/WITHDRAW. Hibernate 6 reads an un-annotated enum as an ordinal (TinyIntJdbcType) and H2 returns 1-based ENUM ordinals, so every read blew up with ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2. Neither EnumType.ORDINAL nor EnumType.STRING matches the stored data, so this is now an explicit converter that maps on the enum's own action label:

@Converter(autoApply = true)
class ActionTypeConverter implements AttributeConverter<ActionType, String> {
    String convertToDatabaseColumn(ActionType a) { return a.getAction(); }        // DEPOSIT -> "Deposit"
    ActionType convertToEntityAttribute(String s) { /* case-insensitive lookup */ }
}

No schema or changelog change was needed — the Liquibase changelogs are untouched.

2. SoapProperties.Endpoint is now static. Boot 3's binder does not instantiate non-static inner classes for nested @ConfigurationProperties binding.

3. jaxws-ri (pom aggregator) → jaxws-rt. The 2.3.0 jaxws-ri pom dragged in the whole Metro distribution — tools, EclipseLink, SDO plugins, samples and docs zips (~30 extra artifacts). The Jakarta-era jaxws-rt:4.0.3 is the runtime-only artifact and is all Endpoint.publish(...) needs.

4. javax.xml.bind:jaxb-api excluded from Liquibase, which still declares the legacy JAXB API; the Jakarta API (jakarta.xml.bind-api:4.0.2) comes in via jaxws-rt. With that exclusion, zero javax.* artifacts remain on the runtime classpath, not just in application code.

5. spring.jpa.database-platform=org.hibernate.dialect.H2Dialect removed — Hibernate 6 logs HHH90000025 for explicitly setting a dialect it auto-detects.

6. Added .github/workflows/build.yml (the repo had no CI) running ./mvnw clean verify on Temurin 21, and SoapPublisherTest, which asserts the WSDL is actually served at http://localhost:8888/baws?wsdl after context startup — the SOAP endpoint publishing path is the piece most likely to break on a JAX-WS major upgrade and was previously untested.

Files touched

  • pom.xml, README.md, .github/workflows/build.yml (new)
  • src/main/java/.../service/BankAccountService.java, BankAccountServiceImpl.java (javax.jws → jakarta.jws)
  • src/main/java/.../config/SoapPublisher.java (javax.xml.ws → jakarta.xml.ws), SoapProperties.java
  • src/main/java/.../entity/Transaction.java (javax.persistence → jakarta.persistence), entity/ActionTypeConverter.java (new)
  • src/main/resources/application.properties
  • src/test/java/.../config/SoapPublisherTest.java (new)

Verification

  • ./mvnw clean verify on Java 21 (21.0.11): BUILD SUCCESS, 7 tests, 0 failures, 0 errors. No existing test was modified.
  • App boots (Started BankWsApplication), Tomcat on 8080, SOAP endpoint published on 8888, WSDL served by "XML-WS Runtime 4.0.3".
  • Live SOAP call returns the same payload as the pre-migration build, including enum labels (DEPOSIT/WITHDRAW) and amounts.

CVEs retired

Vulnerable dependency versions removed from the runtime classpath by this upgrade (verified against OSV.dev for the exact before/after coordinates; not exhaustive — highest-severity items listed):

CVE Severity Vulnerable dependency (before)
CVE-2022-22965 ("Spring4Shell") Critical spring-beans:5.2.6.RELEASE
CVE-2016-1000027 Critical spring-web:5.2.6.RELEASE
CVE-2021-42392 (H2 console RCE) Critical h2:1.4.200
CVE-2022-23221 (H2 console RCE) Critical h2:1.4.200
CVE-2022-0839 (Liquibase XXE) Critical liquibase-core:3.8.9
CVE-2025-24813 (Tomcat RCE) Critical tomcat-embed-core:9.0.35
CVE-2021-25329 (Tomcat RCE) High tomcat-embed-core:9.0.35
CVE-2024-50379 / CVE-2024-56337 (Tomcat TOCTOU RCE) High tomcat-embed-core:9.0.35
CVE-2023-44487 (HTTP/2 Rapid Reset) Moderate tomcat-embed-core:9.0.35
CVE-2022-1471 (SnakeYAML RCE) High snakeyaml:1.26
CVE-2022-25857 High snakeyaml:1.26
CVE-2024-22243 / CVE-2024-22259 / CVE-2024-22262 (SSRF / open redirect) High spring-web:5.2.6.RELEASE
CVE-2021-22118 High spring-web:5.2.6.RELEASE
CVE-2022-22970 High spring-beans:5.2.6.RELEASE
CVE-2020-36518 / CVE-2022-42003 / CVE-2022-42004 High jackson-databind:2.11.0
CVE-2021-46877 High jackson-databind:2.11.0
CVE-2020-25638 (Hibernate SQLi) High hibernate-core:5.4.15.Final
CVE-2019-14900 (Hibernate SQLi) Moderate hibernate-core:5.4.15.Final
CVE-2023-6378 High logback-classic/logback-core:1.2.3
CVE-2021-42550 (logback JNDI) Moderate logback-core:1.2.3
CVE-2021-23463 / CVE-2022-45868 High h2:1.4.200
CVE-2021-28170 Moderate jakarta.el:3.0.3 (dropped; Tomcat EL is used instead)
CVE-2021-24122, CVE-2021-25122, CVE-2022-42252, CVE-2023-24998, CVE-2023-41080, CVE-2023-42795, CVE-2023-45648, CVE-2023-46589, CVE-2024-21733, CVE-2024-24549, CVE-2024-34750, CVE-2024-38286 High/Moderate tomcat-embed-core:9.0.35
CVE-2021-22060 / CVE-2021-22096 Moderate spring-core:5.2.6.RELEASE
CVE-2024-38809 / CVE-2024-38820 Moderate spring-web:5.2.6.RELEASE

Tomcat is pinned to 10.1.55 via <tomcat.version> rather than Boot 3.3.13's managed 10.1.42, which alone still carried several critical advisories (e.g. CVE-2026-43515, CVE-2026-43512, CVE-2026-41293). 10.1.55 is clean per OSV.

Known residual issues (not silently skipped)

  • Not every advisory is retired. jackson-databind:2.17.3 (Boot-managed) still carries open advisories such as CVE-2026-54512/CVE-2026-54513, and spring-core:6.1.21 carries CVE-2025-41249. No fixed release exists within the requested 3.3.x line; clearing these requires moving to a newer Spring Boot minor, which is out of scope for this PR.
  • <date/> is serialised empty in SOAP responses for LocalDateTime fields. This is pre-existing behaviour (JAXB has no built-in LocalDateTime adapter) and is identical before and after the migration; it was deliberately left unchanged to keep the migration behaviour-preserving. Fixing it needs an XmlAdapter and is a separate change.
  • mvnw was committed with the executable bit set (it previously wasn't), so CI can invoke ./mvnw directly.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/33014e603766442185ff7eb0e4b6fb95
Requested by: @vanessasalas-cog


Devin Review

Status Commit
⚪ Not started —

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Devin Review (Staging)
Open in Devin Review

…mespace, dependency/CVE upgrades)

Co-Authored-By: vanessa.salas <vanessa.salas@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

🤖 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

@vercel

vercel Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bank-ws Ready Ready Preview Aug 24, 2026 6:48pm

devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: vanessa.salas <vanessa.salas@cognition.ai>

This branch was successfully deployed

1 active deployment
Preview — c9caf47b Deployed Aug 24, 2026 by vercel[bot]
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.

1 participant