springboot整合mybatis报 NO qualifying bean of type 'com.jvtd.mapper.auth.AdminUserMapper' 把我坑了1天

本文记录了在SpringBoot整合Mybatis时遇到的'No qualifying bean of type'错误,分析了错误原因并提供了解决方案,包括检查启动类位置、mapper扫描、资源配置、XML文件路径、版本兼容性等问题。最终发现是mybatis-spring-boot-starter版本过低导致的冲突,升级到1.3.2后问题解决。
摘要由CSDN通过智能技术生成

2018-08-30 11:35:35.707 WARN 6920 — [ main] o.s.b.f.s.DefaultListableBeanFactory : Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘adminUserMapper’ defined in file [D:\jvtd_operation\op-plal\target\classes\com\jvtd\mapper\auth\AdminUserMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration’: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties’: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration’: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry’ available
2018-08-30 11:35:35.713 DEBUG 6920 — [ main] o.s.b.d.LoggingFailureAnalysisReporter : Application failed to start due to an exception

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.jvtd.mapper.auth.AdminUserMapper’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1506)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1101)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:507)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:485)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:619)atorg.s

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值