Repository navigation
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
Conversation
…mespace, dependency/CVE upgrades) Co-Authored-By: vanessa.salas <vanessa.salas@cognition.ai>
🤖 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:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: vanessa.salas <vanessa.salas@cognition.ai>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 forgetTrasactionsForClient("rshtishi")is byte-identical before and after the migration (verified by running both revisions side by side againsthttp://localhost:8888/baws).Before / after
com.sun.xml.ws:jaxws-ri:2.3.0(pom, javax)com.sun.xml.ws:jaxws-rt:4.0.3(jakarta)Non-obvious changes
1. Enum column mapping broke under Hibernate 6.
Transaction.actionTypemaps to an H2 nativeENUMcolumn whose values are'Deposit'/'Withdraw', while the Java constants areDEPOSIT/WITHDRAW. Hibernate 6 reads an un-annotated enum as an ordinal (TinyIntJdbcType) and H2 returns 1-based ENUM ordinals, so every read blew up withArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2. NeitherEnumType.ORDINALnorEnumType.STRINGmatches the stored data, so this is now an explicit converter that maps on the enum's ownactionlabel:No schema or changelog change was needed — the Liquibase changelogs are untouched.
2.
SoapProperties.Endpointis nowstatic. Boot 3's binder does not instantiate non-static inner classes for nested@ConfigurationPropertiesbinding.3.
jaxws-ri(pom aggregator) →jaxws-rt. The 2.3.0jaxws-ripom dragged in the whole Metro distribution — tools, EclipseLink, SDO plugins, samples and docs zips (~30 extra artifacts). The Jakarta-erajaxws-rt:4.0.3is the runtime-only artifact and is allEndpoint.publish(...)needs.4.
javax.xml.bind:jaxb-apiexcluded from Liquibase, which still declares the legacy JAXB API; the Jakarta API (jakarta.xml.bind-api:4.0.2) comes in viajaxws-rt. With that exclusion, zerojavax.*artifacts remain on the runtime classpath, not just in application code.5.
spring.jpa.database-platform=org.hibernate.dialect.H2Dialectremoved — Hibernate 6 logsHHH90000025for explicitly setting a dialect it auto-detects.6. Added
.github/workflows/build.yml(the repo had no CI) running./mvnw clean verifyon Temurin 21, andSoapPublisherTest, which asserts the WSDL is actually served athttp://localhost:8888/baws?wsdlafter 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.javasrc/main/java/.../entity/Transaction.java(javax.persistence→jakarta.persistence),entity/ActionTypeConverter.java(new)src/main/resources/application.propertiessrc/test/java/.../config/SoapPublisherTest.java(new)Verification
./mvnw clean verifyon Java 21 (21.0.11): BUILD SUCCESS, 7 tests, 0 failures, 0 errors. No existing test was modified.Started BankWsApplication), Tomcat on 8080, SOAP endpoint published on 8888, WSDL served by "XML-WS Runtime 4.0.3".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):
spring-beans:5.2.6.RELEASEspring-web:5.2.6.RELEASEh2:1.4.200h2:1.4.200liquibase-core:3.8.9tomcat-embed-core:9.0.35tomcat-embed-core:9.0.35tomcat-embed-core:9.0.35tomcat-embed-core:9.0.35snakeyaml:1.26snakeyaml:1.26spring-web:5.2.6.RELEASEspring-web:5.2.6.RELEASEspring-beans:5.2.6.RELEASEjackson-databind:2.11.0jackson-databind:2.11.0hibernate-core:5.4.15.Finalhibernate-core:5.4.15.Finallogback-classic/logback-core:1.2.3logback-core:1.2.3h2:1.4.200jakarta.el:3.0.3(dropped; Tomcat EL is used instead)tomcat-embed-core:9.0.35spring-core:5.2.6.RELEASEspring-web:5.2.6.RELEASETomcat is pinned to
10.1.55via<tomcat.version>rather than Boot 3.3.13's managed10.1.42, which alone still carried several critical advisories (e.g. CVE-2026-43515, CVE-2026-43512, CVE-2026-41293).10.1.55is clean per OSV.Known residual issues (not silently skipped)
jackson-databind:2.17.3(Boot-managed) still carries open advisories such as CVE-2026-54512/CVE-2026-54513, andspring-core:6.1.21carries 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 forLocalDateTimefields. This is pre-existing behaviour (JAXB has no built-inLocalDateTimeadapter) and is identical before and after the migration; it was deliberately left unchanged to keep the migration behaviour-preserving. Fixing it needs anXmlAdapterand is a separate change.mvnwwas committed with the executable bit set (it previously wasn't), so CI can invoke./mvnwdirectly.Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/33014e603766442185ff7eb0e4b6fb95
Requested by: @vanessasalas-cog
Devin Review