Error creating bean with name 'userController': Injection of autowired dependenc

jiayongchao2588 2014-06-19 04:39:41
Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.triadgang.miaowei.business.system.controller.UserController.setUserService(com.triadgang.miaowei.business.system.service.UserService); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in file [F:\MiaoWei\MiaoWei\MiaoWei\target\classes\com\triadgang\miaowei\business\system\service\impl\UserServiceImpl.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required求大神看看是什么问题
applicationContext.xml配置

spring-mvc.xml配置

UserController.java

UserServiceImpl.java

目录结构
...全文
10516 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
流浪的行云 2016-04-22
  • 打赏
  • 举报
回复
楼主,最后问题咋出解决的啊,我也遇到同样的问题了
邹邹wl 2015-11-20
  • 打赏
  • 举报
回复
autowired写在属性上,去掉set方法 或者直接去掉autowired注解,保留set方法。 autowired注解就是为了替换掉set方法。
qq_22256655 2015-11-20
  • 打赏
  • 举报
回复
往事也加 2015-07-03
  • 打赏
  • 举报
回复
各位大神能解决这个问题没呢? http://zhidao.baidu.com/question/1959550835681904940.html 十分感谢
asus00 2014-06-19
  • 打赏
  • 举报
回复
把usercontroller中得setUserService上的 annotation删掉.

51,412

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧