From 8e2dd59722a3b6e99f4a6fa202c9479d56dd864d Mon Sep 17 00:00:00 2001 From: Joris Baum Date: Mon, 23 Mar 2026 15:37:10 +0100 Subject: [PATCH] Fix test-service-broker crash on JDK 17 by adding --add-opens flags 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. --- .../src/test/java/org/cloudfoundry/ServiceBrokerUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/integration-test/src/test/java/org/cloudfoundry/ServiceBrokerUtils.java b/integration-test/src/test/java/org/cloudfoundry/ServiceBrokerUtils.java index e3677bd7ba..f4766314f3 100644 --- a/integration-test/src/test/java/org/cloudfoundry/ServiceBrokerUtils.java +++ b/integration-test/src/test/java/org/cloudfoundry/ServiceBrokerUtils.java @@ -145,6 +145,10 @@ public static Mono pushServiceBrokerApplic Map env = new HashMap<>(); env.put("SERVICE_NAME", serviceName); env.put("PLAN_NAME", planName); + env.put( + "JAVA_OPTS", + "--add-opens java.base/java.lang=ALL-UNNAMED" + + " --add-opens java.base/java.io=ALL-UNNAMED"); return ApplicationUtils.pushApplication( cloudFoundryClient,