写后台的时候报错bean创建错误,
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ufpSettWageIFiledCfgController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.risencn.govhr.unifiedpay.genericwageinterface.service.FiledCfgService com.risencn.govhr.unifiedpay.genericwageinterface.controller.UfpSettWageIFiledCfgController.filedCfgService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.risencn.govhr.unifiedpay.genericwageinterface.service.FiledCfgService] 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)}
然后使用修改配置文件内容
<context:component-scan base-package="com.risencn.govhr.*" />
以为扫描的有问题修改了下,指定到我写的包
<context:component-scan base-package="com.risencn.govhr.unifiedpay.*" />
问题依旧。
然后以为tomcat的子文件webapps部署的有问题,clean了下,问题依旧。
排除这两种后,有点苦恼,然后忍着困惑,再看注解位置---这是第n遍看,此时恍然大悟,made,注解写在interface上了--够2了,前面几次看真粗心,开发流程还是记得不牢靠。把service层的注解修改到相应的实现类上面,重新启动tomcat,ok。
分享到:
相关推荐
poi excel 读写 2007 springmvc 实现
1、手写springmvc框架及分析springmvc源码.zip1、手写springmvc框架及分析springmvc源码.zip1、手写springmvc框架及分析springmvc源码.zip1、手写springmvc框架及分析springmvc源码.zip1、手写springmvc框架及分析...
读写分离springMVC项目
java spring springmvc 手写 博客位置: http://knight-black-bob.iteye.com/blog/2407872
springmvc所使用的jar,没有使用maven工具等人可以下载来玩玩
使用Spring+SpringMVC+hibernate做的一个小项目,附带数据库
SpringMVC完整使用教程
springmvc3.0所需jar绿色包
手写SpringMVC,教程请查看个人博客
springmvc开发所需全部包
SpringMVC所需要的jar包,主要用于springMVC的开发
使用springmvc+spring 的框架 使用了apache.commons.fileupload、和springmvc的multipart.MultipartFile 两种技术实现了两种上传方式。
springMVC使用文档
这是一个简单的SpringMVC用aop写操作日志的例子
springmvc自己写的一个例子
springmvc框架所需jar包
自己动手写SpringMVC框架项目源代码,更多详情请查看相关博客:https://blog.csdn.net/qq_31142553/article/details/86582066
使用eclipse 搭建springMvc所需的所有jar包
详细的介绍了使用springmvc做的增删改查,使用了框架
SpringMVC导出excel项目,国外网站下载下来有稍微修改,多次测试可用无bug。