Skip to content

Commit 8e2dd59

Browse files
committed
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.
1 parent 082ff90 commit 8e2dd59

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

integration-test/src/test/java/org/cloudfoundry/ServiceBrokerUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ public static Mono<ApplicationUtils.ApplicationMetadata> pushServiceBrokerApplic
145145
Map<String, Object> env = new HashMap<>();
146146
env.put("SERVICE_NAME", serviceName);
147147
env.put("PLAN_NAME", planName);
148+
env.put(
149+
"JAVA_OPTS",
150+
"--add-opens java.base/java.lang=ALL-UNNAMED"
151+
+ " --add-opens java.base/java.io=ALL-UNNAMED");
148152

149153
return ApplicationUtils.pushApplication(
150154
cloudFoundryClient,

0 commit comments

Comments
 (0)