2019-05-15 16:33:38.981 ERROR 7724 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :ide
APPLICATION FAILED TO START测试
Description:3d
The bean 'readCanDataWeeklyOdoTripTimeTask' could not be injected as a 'com.toyota.task.ReadCanDataWeeklyOdoTripTimeTask' because it is a JDK dynamic proxy that implements: com.toyota.configuration.SchedulingTaskBean代理
Action:rest
Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableCaching.日志
#####以上是Console的错误日志。就是说JAVA的动态代理不能知足须要了,要用CGLIB代理来实现 开始看这个的时候有点蒙,感受本身的程序也不须要CGLIB呢。虽然在启动类中加入@EnableAsync(proxyTargetClass=true)注解就能够运行。可是感受不必啊。 因而开始了错误排查。发现了问题。 2是定时任务的一个Bean接口,实现该接口就成为一个定时任务的task。 1和3都是一个定时任务task。 若是只是单独的1或3,JAVA的动态代理均可以实现功能。 可是在1中,自动注入3,那么JAVA的动态代理就不行了,要借助CGLIB的功能。blog
这个写法只是当初测试方便,用法很奇特,之后引觉得戒。接口