在项目中遇到这个错误,找了几个解决方法,最后第一个方法解决
解决方法
1. jobExecutor
2.0.0版本开始,jobExecutor换成XxlJobSpringExecutor
2.@XxlJob(value = "xxx")要和管理平台页面上的任务的JobHandler一致
3.跟客户端版本要一致
注意:
在低版本的 xxl-job 中, 初始化 XxlJobSpringExecutor 执行器需要在 @Bean 中加上 initMethod = "start", destroyMethod = "destroy",但是在高版本的 xxl-job(如 2.1.2)则需要删除 initMethod = "start", destroyMethod = "destroy",否则会报java.net.BindException: Address already in use: bind错误