Skip to content

Fix test-service-broker crash on JDK 17 by adding --add-opens flags#1345

Open
jorbaum wants to merge 1 commit intocloudfoundry:5.x.xfrom
jorbaum:buildpack-5-0-0-workaround
Open

Fix test-service-broker crash on JDK 17 by adding --add-opens flags#1345
jorbaum wants to merge 1 commit intocloudfoundry:5.x.xfrom
jorbaum:buildpack-5-0-0-workaround

Conversation

@jorbaum
Copy link

@jorbaum jorbaum commented Mar 23, 2026

Workaround for #1344 .

The test-service-broker.jar (Spring Boot 1.5.16 / Spring Framework 4.3.19) uses CGLIB proxying which requires reflective access to java.lang.ClassLoader.defineClass(). JDK 17's module system blocks this, causing the app to crash on startup with
InaccessibleObjectException and all ApplicationsTest methods to fail with DelayTimeoutException during serviceBrokerId bean creation.

Creating this as a draft as this is a workaround only to some parts of the integration tests work again.

AI tools used: Claude Code and GitHub Copilot (Opus 4.6) assisted me during development. I reviewed the result.

@Kehrlann Kehrlann self-requested a review March 24, 2026 09:56
@Kehrlann Kehrlann changed the base branch from main to 5.x.x March 24, 2026 09:57
@Kehrlann Kehrlann changed the base branch from 5.x.x to main March 24, 2026 09:57
Kehrlann
Kehrlann previously approved these changes Mar 24, 2026
Copy link
Contributor

@Kehrlann Kehrlann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hotfix. Please target the 5.x.x branch. We'll forward port this.

The test-service-broker.jar (Spring Boot 1.5.16 / Spring Framework
4.3.19) uses CGLIB proxying which requires reflective access to
java.lang.ClassLoader.defineClass(). JDK 17's module system blocks
this, causing the app to crash on startup with
InaccessibleObjectException and all ApplicationsTest methods to fail
with DelayTimeoutException during serviceBrokerId bean creation.
@jorbaum jorbaum force-pushed the buildpack-5-0-0-workaround branch from ef0f69e to 8e2dd59 Compare March 26, 2026 10:06
@jorbaum jorbaum changed the base branch from main to 5.x.x March 26, 2026 10:07
@jorbaum jorbaum marked this pull request as ready for review March 26, 2026 10:15
@jorbaum
Copy link
Author

jorbaum commented Mar 26, 2026

I pushed the version that was rebased on 5.x.x .

However, there is also test-log-cache.jar which might have similar issues. Even though I did not run into issues with it for the integration tests that I ran.

Do you think the changes in this PR are fine without looking into / adding an additional workaround for test-log-cache.jar ?

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.

2 participants