Error creating bean with name 'fileController': Injection of resource dependencies failed;(示
Posted umblog
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Error creating bean with name 'fileController': Injection of resource dependencies failed;(示相关的知识,希望对你有一定的参考价值。
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;(示的主要内容,如果未能解决你的问题,请参考以下文章
Error creating bean with name ‘requestMappingHandlerMapping‘
react(85)--error:Error creating bean with name ‘onlineStudyController‘:
Error creating bean with name 'eurekaAutoServiceRegistration'