1.注释掉热部署pom
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> </dependency>
2.修改定时任务 强制转换方法
类名:ScheduleJob
修改前
ScheduleJobEntity scheduleJob = (ScheduleJobEntity) context.getMergedJobDataMap(). get(ScheduleUtils.JOB_PARAM_KEY);
修改后
//解决热部署冲突 Object temp = context.getMergedJobDataMap().get((ScheduleUtils.JOB_PARAM_KEY)); ScheduleJobEntity scheduleJob; String string = JSON.toJSON(temp).toString(); scheduleJob = JSON.parseObject(string,ScheduleJobEntity.class);