-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Destroy method not found in Native image for ExecutorService
Bean type
#32006
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
Looks indeed very similar to #29545, especially given the fact that Surprisingly, I can't reproduce with using SDKman with That likely indicates that this is a GraalVM limitation or bug only fixed in recent versions. As consequence, and since we don't have any actionable item on Spring side, I close this ticket. I advise you to use a more recent GraalVM distribution or add invoke reflection hints on |
@sdeleuze thank you for quick investigation! For the Java 17 ( {
"name": "java.util.concurrent.ExecutorService",
"queryAllPublicMethods": true,
"queryAllDeclaredMethods": true,
"methods": [
{
"name": "shutdown", <<== one method, which is not default in ExecutorService interface
"parameterTypes": [ ]
}
]
},
...but for the Java 21 ( {
"name": "java.util.concurrent.ExecutorService",
"queryAllPublicMethods": true,
"queryAllDeclaredMethods": true,
"methods": [
{
"name": "close", <<== new default method
"parameterTypes": [ ]
}
]
}, ...because, since the Java 19 So, probably this is the issue? |
Good catch, this is probably the reason for such difference of behavior. But that's does not explain why the repro for #29545 works and this one on Java 17 doesn't. After a deeper look, I think I found the cause: #29545 does not attempt to find methods in superclass interfaces. As a consequence, I reopen this issue. |
ExecutorService
Bean type
@sdeleuze I suppose this should be backported to 6.0.x as well? |
* pr/200: Polish "Add a reproducer for spring-projects/spring-framework#32006" Add a reproducer for spring-projects/spring-framework#32006 Closes gh-200
Describe the issue
I have a Spring Boot 3 (version 3.2.1) app with nothing on the classpath except
spring-boot-starter
.if I use following code:
...and then compile as Native image:
...and run:
...then I get the following error:
And if I'll switch bean type to a precise one: (
ThreadPoolExecutor
) instead of (ExecutorService
), then it works:This issue is almost exactly the same like this one: #29545 except that now it only reproducing for
ExecutorService
.Steps to reproduce the issue
Please see reproducible Demo app: spring-native-executor-demo.zip
Describe GraalVM and your environment:
The text was updated successfully, but these errors were encountered: