Error creating bean with name 'backPrintPaperController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqxkzxxService com.chinauip.cfc.business.labre.lwpq.view.BackPrintPaperController.tblabrelatlwpqxkzxxService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tblabrelatlwpqxkzxxService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqxkzxxService.tblabrelatlwpqdwxxService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tblabrelatlwpqdwxxService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService.tblabrelatlwpqdwxxService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: [com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
1.檢查第一個錯誤:tblabrelatlwpqxkzxxService類發生:Could not autowire field
不能 private com.chinauip.cfc.business.labre.lwpq.service.TblabrelatlwpqdwxxService
為什么不能 autowire TblabrelatlwpqdwxxService類呢?
2.檢查第二個錯誤:No matching bean ...注入失敗.
靠....原來自己把自己注入了.好吧,又是copy惹的禍.!!!!
回復:@ Wangcaiyun
我這里引起錯誤原因是 因為在類里面 自動注入了本身.
只要把那兩行代碼刪除就正常了.
忘記把解決方案寫出來了