我的spring启动微服务目前使用Spring-Boot2.2.9运行。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>我也还用
依赖项。
现在我想要切换到SpringBoot2.3.2.RELEASE,我可以编译代码而没有任何错误。启动服务后,我看到
信息: HHH000490:使用JtaPlatform实现:JtaPlatform
日志信息。现在出现了错误。然后部署过程停止。什么都没发生。
目前我不知道为什么它不运行。有人有什么建议吗?
发布于 2020-08-30 19:28:14
我想我找到问题了。
@EnableEurekaClient
@EnableScheduling
@SpringBootApplication
@EnableAsync
public class AccountApplication {
public static void main(String[] args) {
SpringApplication.run(AccountApplication.class, args);
}
@Bean("threadPoolTaskExecutor")
public Executor asyncExecutor() {
final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(20);
executor.setMaxPoolSize(1000);
executor.setThreadNamePrefix("AsyncThread-");
executor.initialize();
return executor;
}
}而不是我在代码中使用了Exceutor:
@Async("threadPoolTaskExecutor")
public CompletableFuture<ServiceAccountDTO> registerAccountInService(final String uuid, final ServiceEnum serviceEnum,
final Date creationDate, final Date realCreationDate) {
..
}使用此配置,服务没有正确启动。
现在,@Bean("threadPoolTaskExecutor")配置被删除,我只使用@异步。
但是为什么它不能使用2.3.x呢?日志中没有错误信息。
https://stackoverflow.com/questions/63331441
复制相似问题