求助,使用quartz做调度器时出问题,找不出原因了
quartz执行类
[ERROR]-[Thread: quartzScheduler_QuartzSchedulerThread]-[org.quartz.core.ErrorLogger.schedulerError()]: An error occured instantiating job to be executed. job= 'pro.12'
org.quartz.SchedulerException: Problem instantiating class 'com.test.config.quartz.job.ProJob' [See nested exception: java.lang.IllegalArgumentException: Can not set com.test.business.service.ProductService field com.test.business.service.BillService.productService to com.test.business.service.BillService$$EnhancerByJFinal]
at org.quartz.simpl.SimpleJobFactory.newJob(SimpleJobFactory.java:58)
at org.quartz.simpl.PropertySettingJobFactory.newJob(PropertySettingJobFactory.java:69)
at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:392)
Caused by: java.lang.IllegalArgumentException: Can not set com.test.business.service.ProductService field com.test.business.service.BillService.productService to com.test.business.service.BillService$$EnhancerByJFinal
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:75)
at java.lang.reflect.Field.set(Field.java:764)
at com.jfinal.aop.AopFactory.doInject(AopFactory.java:167)
at com.jfinal.aop.AopFactory.doGetSingleton(AopFactory.java:93)
at com.jfinal.aop.AopFactory.doGet(AopFactory.java:65)
at com.jfinal.aop.AopFactory.get(AopFactory.java:48)
at com.jfinal.aop.Aop.get(Aop.java:101)
at com.test.config.quartz.job.ProJob.<init>(ProJob.java:12)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.quartz.simpl.SimpleJobFactory.newJob(SimpleJobFactory.java:56)
... 3 more
Can not set com.test.business.service.ProductService field com.test.business.service.BillService.productService to com.test.business.service.BillService$$EnhancerByJFinal]
变量类型不对,可能是你映射有问题,估计是你添加了:
AopManager.me().addMapping(...)
造成类型问题,检查一下