Spring AOP has been used to inject some of the session scope objects, but today the following exceptions occur when deploying such applications:
[09-12-25 14:50:52:562 CST] 0000003f WebApp E srve0026e: [Servlet error]-[filter [Identityfilter]: Filter is Unav Ailable.]:org.springframework.beans.factory.beancreationexception:error creating bean with Name ' Scopedtarget.sessionuser ': Scope ' session ' isn't active for the current thread; Consider defining a scoped proxy for this beans if you are intend to refer to it from Singleton; Nested exception is Java.lang.IllegalStateException:No thread-bound request Found:are your referring to request attribute s outside of an actual Web request? If you are are actually operating within a Web request and still receive this message,your the code is probably running outside of Dispatcherservlet/dispatcherportlet:in this case, use Requestcontextlistener or requestcontextfilter to expose the Curre NT request.
caused By:java.lang.IllegalStateException:No thread-bound request Found:are you referring to request attributes outside of an actual Web request? If you are are actually operating within a Web request and still receive this message,your the code is probably running outside of Dispatcherservlet/dispatcherportlet:in this case, use Requestcontextlistener or requestcontextfilter to expose the Curre NT request.
At Org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes ( REQUESTCONTEXTHOLDER.JAVA:102)
At Org.springframework.web.context.request.SessionScope.get (sessionscope.java:88)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:285)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:160)
At Org.springframework.aop.target.SimpleBeanTargetSource.getTarget (simplebeantargetsource.java:33)
At Org.springframework.aop.framework.cglib2aopproxy$dynamicadvisedinterceptor.gettarget (Cglib2AopProxy.java:661 )
At Org.springframework.aop.framework.cglib2aopproxy$dynamicadvisedinterceptor.intercept (Cglib2AopProxy.java:611 )
At .....
At Java.lang.String.valueOf (String.java (inlined Compiled Code))
At Java.lang.StringBuffer.append (Stringbuffer.java (Compiled Code))
...
After half a day of information, there is no one to solve, there is no way, there is spring to look at the document, and finally the Web.xml file used in the listener to filter the problem solved, is to
<listener> <listener-class> Org.springframework.web.context.request.RequestContextListener </ Listener-class> </listener>
Change into
<filter> <filter-name>requestContextFilter</filter-name> <filter-class> Org.springframework.web.filter.requestcontextfilter</filter-class> </filter> <filter-mapping> <filter-name>requestContextFilter</filter-name> <url-pattern>/*</url-pattern> </ Filter-mapping>
But the specific reason is still not clear, and then have time to take a good look.