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

原创 2018年04月17日 17:21:06

今天在做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;类型的报错,显然要考虑依赖出错了

linux下weblogic ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V异常

工程在本地windows机器上面安装weblogic部署正常,迁移到linux(64位)下安装32位的weblogic10.3出现异常   ...
  • xiaxiaorui2003
  • xiaxiaorui2003
  • 2013-01-23 20:20:40
  • 1907

Spring 报错集合

Spring报错的集合 NoSuchMethodError AnnotatedElementUtils...
  • u010543785
  • u010543785
  • 2016-10-25 13:20:31
  • 2599

NoSuchMethodError: org.springframework.core.convert.Property.<init>(Ljava/lang/Class;Ljava/lang/refl

NoSuchMethodError: org.springframework.core.convert.Property.(Ljava/lang/Class;Ljava/lang/reflect/Me...
  • zhangxiaomin1992
  • zhangxiaomin1992
  • 2016-12-04 12:09:09
  • 512

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

java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.getMethod(Ljava/lang/Class;Ljava/la...
  • coffeesweet
  • coffeesweet
  • 2016-08-27 18:05:51
  • 5203

NoSuchMethodError aop.support.AopUtils.selectInvocableMethod(Ljava/lang/reflect/Method;Ljava/lang/Cl

WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.sprin...
  • weixin_39947101
  • weixin_39947101
  • 2017-12-11 15:20:35
  • 63

java.lang.reflect.Method (java反射机制)

公司Vac方法过滤器使用到反射机制,读取xml配置文件过滤用户访问的方法名是否合法。public void doFilter(ServletRequest request, ServletRespon...
  • cuker919
  • cuker919
  • 2010-05-19 16:47:00
  • 4174

java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/refl

仔细检查是由于有两个包asm2.0.3.jar和asm.jar以及有spring-core.jar和spring-2.0.5core.jar,包冲突,删除asm2.0.3.jar和spring-2.0...
  • zdwzzu2006
  • zdwzzu2006
  • 2011-09-14 21:54:13
  • 7589

初次使用springboot错误(NoSuchMethodError: ...addServletMapping(Ljava/lang/String;Ljava)以及(ClassNotFound)

第一次使用springboot 发现 貌似这货与tomcat9不兼容,折磨了两天终于找到解决方法, 如果你也 跑不起来springboot,不妨来看看...
  • qq_33530388
  • qq_33530388
  • 2017-06-13 17:12:15
  • 2176

JNI WARNING: illegal class name 'Ljava/lang/String;' (FindClass)

jclass objClass = env->FindClass("java/lang/String");//定义数组中元素类型 而不是FindClass("Ljava/lang/String;")...
  • scut1135
  • scut1135
  • 2012-08-02 13:51:54
  • 5135

spring3的一个报错,原因是maven依赖包冲突,有重复的依赖。

报错如下:严重: Context initialization failed org.springframework.beans.BeanInstantiationException: Could n...
  • Longerandlonger
  • Longerandlonger
  • 2012-02-22 11:06:15
  • 23462
收藏助手
不良信息举报
您举报文章:spring boot整合quartz报错:Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
举报原因:
原因补充:

(最多只允许输入30个字)