首页 > 其他 > 详细

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

时间:2018-07-09 10:02:19      阅读:245      评论:0      收藏:0      [点我收藏+]

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;

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!