SSM中关于service中mapper注入失败org.springframework.beans.factory.UnsatisfiedDependencyException: Error crea
2018-04-07 02:02
2071 查看
报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org
原因:这个错误就是由于Mapper.xml放在了src/main/resources资源文件中,而扫描的位置却是:com.study.web.mapper
1,如果是这样配置:<!-- Mapper映射文件的包扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.study.web.mapper" />
</bean>
那么遵守mapper文件位置,放一个文件夹上,如下图
原因:这个错误就是由于Mapper.xml放在了src/main/resources资源文件中,而扫描的位置却是:com.study.web.mapper
1,如果是这样配置:<!-- Mapper映射文件的包扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.study.web.mapper" />
</bean>
那么遵守mapper文件位置,放一个文件夹上,如下图
相关文章推荐
- 关于Spring中org.springframework.beans.factory.UnsatisfiedDependencyException异常
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name'se
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com
- org.springframework.beans.factory.UnsatisfiedDependencyException异常
- org.springframework.beans.factory.UnsatisfiedDependencyException
- 关于SSM整合中遇到的org.springframework.beans.factory.BeanDefinitionStoreException: IOException pars 问题
- org.springframework.beans.factory.UnsatisfiedDependencyException
- SSM_bug:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'LoginService
- spring + redis + org.springframework.beans.factory.UnsatisfiedDependencyException:
- org.springframework.beans.factory.UnsatisfiedDependencyException
- org.springframework.beans.factory.UnsatisfiedDependencyException异常
- org.springframework.beans.factory.BeanCreationException: Error creating bean SMSService
- mapper注入失败问题解决 {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- org.springframework.beans.factory.UnsatisfiedDependencyException
- 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.UnsatisfiedDependencyException
- Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wi
- 关于org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFac
- org.springframework.beans.factory.UnsatisfiedDependencyException 异常这么解决