3个文件,web.xml,applicationContext.xml,springmvc.xml,现在启动报错
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.xebest.service.XeUserTypeService com.xebest.controller.HomeController.xeUserTypeService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xeUserTypeServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.xebest.mapper.XeUserTypeReadMapper com.xebest.service.serviceImpl.XeUserTypeServiceImpl.xeUserTypeReadMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.xebest.mapper.XeUserTypeReadMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
a
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.xebest.service.XeUserTypeService com.xebest.controller.HomeController.xeUserTypeService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xeUserTypeServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.xebest.mapper.XeUserTypeReadMapper com.xebest.service.serviceImpl.XeUserTypeServiceImpl.xeUserTypeReadMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.xebest.mapper.XeUserTypeReadMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
a
解决方案 »
- 【紧急】我想问一下HTML的TITLE标签,里面的内容能填写多少个?有限制吗
- jsp 页面,中上传图片的问题
- java 能获取到文字所使用某种字体后的宽度及高度吗?
- 编译好的javabeans应放在哪?
- 简单问题,请教高手
- 我有一个很重要的问题呀1
- 特殊字符引起的乱码问题(求助)
- 请问列表中多条数据更新怎么做啊?有例子最好
- 急等 pdf在线预览功能关于swf上传及下载问题!!!!在线等
- jpa 一对多和多对多出现的问题 Use of @OneToMany or @ManyToMany targeting an unmapped class:xx
- 请问:mybatis 将日期类型字段插入到mysql数据库日期类型的字段中报错,怎么解决?急求
- springmvc 验证报错
applicationContext.xml少一个东西,你添加一下:<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"
p:basePackage="com.xebest.mapper.XeUserTypeReadMapper"
p:sqlSessionFactoryBeanName="sqlSessionFactory" />如果你用不了这种表达,换成:<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.xebest.mapper.XeUserTypeReadMapper"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>我这边手打的,没有测试,你根据你自己的情况改一下
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.xebest.mapper"></property>
</bean>,你试试