码迷,mamicode.com
首页 > 其他好文 > 详细

Error creating bean with name 'fileController': Injection of resource dependencies failed;

时间:2018-07-09 11:08:08      阅读:1267      评论:0      收藏:0      [点我收藏+]

标签:frame   request   方法   zed   within   XML   rpo   lstat   erro   

1.错误描述

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name fileController: Injection of resource dependencies failed; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

2.问题解决

【1】网上很多的方法都是在web.xml里面增加监听器;但是原本已经有了,所以不是监听器的问题。

【2】后来发现代码中多了一行@Resource注解;删除即可解决问题。

技术分享图片

 

Error creating bean with name 'fileController': Injection of resource dependencies failed;

标签:frame   request   方法   zed   within   XML   rpo   lstat   erro   

原文地址:https://www.cnblogs.com/umblog/p/9282207.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!