java.lang.ClassCastException: io.unify.modules.job.entity.ScheduleJobEntity
cannot be cast to io.unify.modules.job.entity.ScheduleJobEntity
at io.unify.modules.job.utils.ScheduleJob.executeInternal(ScheduleJob.java:40)
at
org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
具体执行代码:
现象:debug发现可以获取到对象且对象属性值也是没问题的,但就是报错
原因:
项目中应该是采用了热部署,devtools,因为类加载器的不同所以会导致类型转换失败;
取消热部署依赖
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId> <scope>true</scope>