-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Open
Labels
status: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided on
Description
I'm getting an error when trying to create a proxy for a REST controller method that returns a CompletableFuture
. If I change the return type to Future
, it works fine.
...
Caused by:
org.springframework.cglib.core.ReflectUtils$1: ClassLoader mismatch for [java.util.concurrent.CompletableFuture]: JVM should be started with --add-opens=java.base/java.lang=ALL-UNNAMED for ClassLoader.defineClass to be accessible on jdk.internal.loader.ClassLoaders$AppClassLoader; consider co-locating the affected class in that target ClassLoader instead.
at app//org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:551)
at app//org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:375)
at app//org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:575)
at app//org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.lambda$new$1(AbstractClassGenerator.java:107)
at app//org.springframework.cglib.core.internal.LoadingCache.lambda$createEntry$1(LoadingCache.java:52)
at java.base@21.0.8/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at app//org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:57)
at app//org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
at app//org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:129)
at app//org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:321)
at app//org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:562)
at app//org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:407)
at app//org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder$ControllerMethodInvocationInterceptor.initProxy(MvcUriComponentsBuilder.java:800)
at app//org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder$ControllerMethodInvocationInterceptor.intercept(MvcUriComponentsBuilder.java:722)
... 2 more
Caused by:
java.lang.IllegalAccessException: module java.base does not open java.util.concurrent to unnamed module @7098b907
at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:537)
... 15 more
Metadata
Metadata
Assignees
Labels
status: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided on