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>

技术
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信