Java并行流 No thread-bound request found
生活随笔
收集整理的這篇文章主要介紹了
Java并行流 No thread-bound request found
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
異常如下:
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.解決方案:
在web.xml中添加一個監(jiān)聽
<listener><listener-class>org.springframework.web.context.request.RequestContextListener</listener-class></listener> </web-app> 創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的Java并行流 No thread-bound request found的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 解决SecureCRT与SecureFX
- 下一篇: Java高级特性——反射