You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'executorService': Invalid destruction signature
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:643) ~[demo:6.1.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[demo:6.1.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[demo:6.1.2]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[demo:6.1.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[demo:6.1.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[demo:6.1.2]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[demo:6.1.2]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:960) ~[demo:6.1.2]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625) ~[demo:6.1.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) ~[demo:3.2.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:464) ~[demo:3.2.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[demo:3.2.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1358) ~[demo:3.2.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1347) ~[demo:3.2.1]
at com.example.demo.DemoApplication.main(DemoApplication.java:15) ~[demo:na]
Caused by: org.springframework.beans.factory.support.BeanDefinitionValidationException: Could not find a destroy method named 'shutdown' on bean with name 'executorService'
at org.springframework.beans.factory.support.DisposableBeanAdapter.<init>(DisposableBeanAdapter.java:134)~[na:na]
at org.springframework.beans.factory.support.AbstractBeanFactory.registerDisposableBeanIfNecessary(AbstractBeanFactory.java:1868) ~[demo:6.1.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:639) ~[demo:6.1.2]
And if I'll switch bean type to a precise one: (ThreadPoolExecutor) instead of (ExecutorService), then it works:
// This works@BeanThreadPoolExecutorexecutorService() {
return (ThreadPoolExecutor) Executors.newFixedThreadPool(10);
}
// This doesn't work@BeanExecutorServiceexecutorService() {
returnExecutors.newFixedThreadPool(10);
}
This issue is almost exactly the same like this one: #29545 except that now it only reproducing for ExecutorService.
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: