Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of ty
2017-06-27 13:37
706 查看
搭建框架的时候遇见这么一个错误
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.etoak.repository.LoginoutMapper' available: expected at least 1 bean which qualifies as autowire
candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
这个问题的原因就是在于在配置文件中没有相关的解析mapper的配置
解决办法:
<!-- DAO接口所在包名,Spring会自动查找其下的类 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.etoak.repository" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>要注意:第二个注解使用name的方式找到SqlsessionFactory
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.etoak.repository.LoginoutMapper' available: expected at least 1 bean which qualifies as autowire
candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
这个问题的原因就是在于在配置文件中没有相关的解析mapper的配置
解决办法:
<!-- DAO接口所在包名,Spring会自动查找其下的类 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.etoak.repository" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>要注意:第二个注解使用name的方式找到SqlsessionFactory
相关文章推荐
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of ty
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.cui
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.oskyhang.gbd.service.UserService] found for dependency: expected at least 1 bean which qualifies as aut
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.wei
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'http://10
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.act
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
- Spring 报错 org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of typ
- shiro错误 org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.wan
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.lin
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.itca
- 菜鸟解答:Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException
- spring 框架错误 org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.yuanv.b
- spring cloud在编写测试用例时报错:Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: N
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.serv
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [