TsfScheduleConfiguration冲突导致无法启动问题
问题现象
java.lang.IllegalStateException: @Bean method TsfScheduleConfiguration.tsfTaskExecutor called as bean reference for type [java.util.concurrent.ScheduledExecutorService] but overridden by non-compatible bean instance of type [org.springframework.cloud.sleuth.instrument.async.TraceableExecutorService]. Overriding bean of same name declared in: class path resource [org/springframework/tsf/core/config/TsfScheduleConfiguration.class]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.resolveBeanReference(ConfigurationClassEnhancer.java:420) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:368) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.tsf.core.config.TsfScheduleConfiguration$$EnhancerBySpringCGLIB$$be08a012.tsfTaskExecutor(<generated>) ~[spring-cloud-tsf-core-1.14.2-Finchley-RELEASE.jar:1.14.2-Finchley-RELEASE]
at org.springframework.tsf.core.config.TsfScheduleConfiguration.configureTasks(TsfScheduleConfiguration.java:25) ~[spring-cloud-tsf-core-1.14.2-Finchley-RELEASE.jar:1.14.2-Finchley-RELEASE]
at org.springframework.tsf.core.scheduling.TsfScheduledAnnotationBeanPostProcessor.finishRegistration(TsfScheduledAnnotationBeanPostProcessor.java:243) ~[spring-cloud-tsf-core-1.14.2-Finchley-RELEASE.jar:1.14.2-Finchley-RELEASE]
at org.springframework.tsf.core.scheduling.TsfScheduledAnnotationBeanPostProcessor.onApplicationEvent(TsfScheduledAnnotationBeanPostProcessor.java:217) ~[spring-cloud-tsf-core-1.14.2-Finchley-RELEASE.jar:1.14.2-Finchley-RELEASE]
at org.springframework.tsf.core.scheduling.TsfScheduledAnnotationBeanPostProcessor.onApplicationEvent(TsfScheduledAnnotationBeanPostProcessor.java:108) ~[spring-cloud-tsf-core-1.14.2-Finchley-RELEASE.jar:1.14.2-Finchley-RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:400) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:354) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:886) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.0.7.RELEASE.jar:2.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.0.11.RELEASE.jar:5.0.11.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.0.7.RELEASE.jar:2.0.7.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) [spring-boot-2.0.7.RELEASE.jar:2.0.7.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386) [spring-boot-2.0.7.RELEASE.jar:2.0.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-2.0.7.RELEASE.jar:2.0.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242) [spring-boot-2.0.7.RELEASE.jar:2.0.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1230) [spring-boot-2.0.7.RELEASE.jar:2.0.7.RELEASE]
at pdfc.platform.Application.main(Application.java:29) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.0.7.RELEASE.jar:2.0.7.RELEASE]
解决方法
排除如下包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>