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
這個寫法只是當初測試方便,用法很奇特,之後引覺得戒。接口