描述
这个问题出现之后反复的校验配置文件是否配置了 xml 文件的加载,,mapper 映射文件的位置,
都是对的,也百度了,没有找到正确的解决方式多是说 xml文件的位置,@MapperScan 等问题,
其实,是因为搜索的方式错了。。。
异常信息
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2018-09-03 14:21:14.274 ERROR 14496 — [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController’: Unsatisfied dependency expressed through field ‘userService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userServiceImpl’: Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.baomidou.springboot.cususer.mapper.UserMapper’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor A u t o w i r e d F i e l d E l e m e n t . i n j e c t ( A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . j a v a : 587 ) [ s p r i n g − b e a n s − 5.0.7. R E L E A S E . j a r : 5.0.7. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . a n n o t a t i o n . I n j e c t i o n M e t a d a t a . i n j e c t ( I n j e c t i o n M e t a d a t a . j a v a : 91 ) [ s p r i n g − b e a n s − 5.0.7. R E L E A S E . j a r : 5.0.7. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . a n n o t a t i o n . A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . p o s t P r o c e s s P r o p e r t y V a l u e s ( A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . j a v a : 373 ) [ s p r i n g − b e a n s − 5.0.7. R E L E A S E . j a r : 5.0.7. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . p o p u l a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1350 ) [ s p r i n g − b e a n s − 5.0.7. R E L E A S E . j a r : 5.0.7. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d o C r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 580 ) [ s p r i n g − b e a n s − 5.0.7. R E L E A S E . j a r : 5.0.7. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . c r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 503 ) [ s p r i n g − b e a n s − 5.0.7. R E L E A S E . j a r : 5.0.7. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . l a m b d a AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:587) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1350) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:580) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:503) ~[spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:587) [spring−beans−5.0.7.RELEASE.jar:5.0.7.RELEASE]atorg.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91) [spring−beans−5.0.7.RELEASE.jar:5.0.7.RELEASE]atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373) [spring−beans−5.0.7.RELEASE.jar:5.0.7.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1350) [spring−beans−5.0.7.RELEASE.jar:5.0.7.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java: