热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

springboot集成OncePerRequestFilter,是什么原因?

1.springboot中我重写了一个filter,结果偶发性的出现空指针

1.springboot中我重写了一个filter,结果偶发性的出现空指针



2.

java.lang.NullPointerException: null
    at org.apache.catalina.connector.Request.notifyAttributeAssigned(Request.java:1555) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.catalina.connector.Request.setAttribute(Request.java:1541) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:540) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:252) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:252) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:252) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.springframework.web.context.request.async.WebAsyncUtils.getAsyncManager(WebAsyncUtils.java:51) ~[spring-web-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:928) ~[spring-webmvc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877) ~[spring-webmvc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) ~[spring-webmvc-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
--
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1697) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_171]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_171]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-8.5.29.jar!/:8.5.29]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]





   



推荐阅读
author-avatar
小旋律丶_409
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有