-
Notifications
You must be signed in to change notification settings - Fork 472
Issues with DummyInvocationUtils on Java 17 #1806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Are you using Spring Framework / HATEOAS on the module path? Or does the error also appear in a plain classpath arrangement? A reproducer would be super helpful. |
I'm not sure what you mean. |
Here you go: Start the project using Please let me know if you need anything else. For reference, the controller code in the demo project looks like this: public class DemoController {
@GetMapping("/entity/{id}")
public CompletableFuture<Object> getEntity(@PathVariable String id) {
return CompletableFuture.completedFuture(Map.of("id", id));
}
@GetMapping("/help")
public Object getHelp() {
return Map.of("urls",
Map.of("entity", WebMvcLinkBuilder
// this is where the exception occurrs
.linkTo(WebMvcLinkBuilder.methodOn(DemoController.class).getEntity(null))
.withSelfRel().getHref()));
}
} The stacktrace is
|
That's helpful, thanks!
That, too! I'll have a look ASAP. |
If I omit the |
For interfaces, JDK proxies are generated. For concrete types, we need to create a class-based (CGLib) proxy, which fails as the JDK rejects a reflective reference to the core JDK type. We're currently investigating the issue internally. Can you switch to |
I'll try that. I only just found that workaround myself. 😉 |
Looks promising. I think I'll be able to work around the issue for us thanks to your quick and helpful response. Thanks! |
Glad to hear that! I'll keep it around until we come to an official conclusion. Could be a fix or just some tweak to the documentation outlining the limitation or configuration flags to set when running the app to re-enable those types being proxied. |
Hi @jochenberger,
@jhoeller suggested that you instead use What happens if you instead do that? |
@sbrannen, yes, that does seem to help. At least with the demo project. I didn't try the other one yet. |
I'm trying to move a project from Java 11 to Java 17 and I'm having issues with code that creates resource URLs.
The Controller method returns a CompletableFuture.
When I switch to Java 17, I get
If I add
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
, I getPlease let me know if I can provide any more details.
The text was updated successfully, but these errors were encountered: