dao層bean注入失敗
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'app':
Unsatisfied dependency expressed through field 'userDOMapper': No qualifying bean of type [com.cut.dao.UserDOMapper] found for dependency [com.cut.dao.UserDOMapper]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.cut.dao.UserDOMapper] found for dependency [com.cut.dao.UserDOMapper]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
求大神解救一下,一直報(bào)這個錯誤,開始我完全照老師的代碼,報(bào)這個錯誤,后來我把接口類加上Component注解或者Repository注解反正能換的我都試過了,完全報(bào)同樣的錯誤,檢查了各個配置的路徑也沒有錯誤,代碼不報(bào)錯,編譯報(bào)錯。不知道問題出在哪,怎么解決??
2019-09-03
把所有接口上的注解改成@Mapper問題解決
2019-08-23
你這個問題解決了嗎?
2019-05-28
2019-05-27
用@Resource代替@autowried
2019-05-08
這個好像是生成的UserDOMapper.xml和UserPasswordDOMapper.xml文件中重復(fù)生成了resultMap,然后刪掉重復(fù)的就好了,希望有幫助
2019-05-07
對userDoMapper變量進(jìn)行setter方式注入,試試