spring boot整合quartz报错:Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/reflect/Constructor;

今天在做spring boot与quartz整合的时候报错

org.quartz.SchedulerException: Job instantiation failed
	at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:47)
	at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
	at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:392)
Caused by: java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.accessibleConstructor(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
	at org.springframework.scheduling.quartz.AdaptableJobFactory.createJobInstance(AdaptableJobFactory.java:61)
	at org.springframework.scheduling.quartz.SpringBeanJobFactory.createJobInstance(SpringBeanJobFactory.java:77)
	at com.ylkj.zhantai.ws12345.SpringJobFactory.createJobInstance(SpringJobFactory.java:29)
	at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:43)
	... 2 common frames omitted

原因不明,很困惑。后来看到一篇文章:

Spring报错java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMethod(Ljava/lang/Class

想了起来,由于spring boot整合quartz要加入两个依赖

	compile group: 'org.springframework', name: 'spring-context-support', version: '5.0.5.RELEASE'
	compile group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.0'

而这里没有考虑到spring framework的版本,而gradle的spring boot版本信息不太清晰


改为4.3.8就可以了

经验:以后看到这种Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/reflect/Constructor;类型的报错,显然要考虑依赖出错了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值