东方通中间件SystemOutLogger.log报错

使用东方通java代码中执行system.out.println(obj)时偶尔报错,咨询同事排查后发现如果obj是null,会抛出如下异常:

[2022-08-18 10:18:13] [WARNING] [System.out] [java.lang.NullPointerException]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.log.SystemOutLogger.log(SystemOutLogger.java:373)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.log.PassThroughPrintStream.println(PassThroughPrintStream.java:66)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.webutil.util.log.SystemLogHandler.println(SystemLogHandler.java:264)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.interceptor.StopWatchHandlerInterceptor.postHandle(StopWatchHandlerInterceptor.java:307)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.springframework.web.servlet.HandlerExecutionChain.applyPostHandle(HandlerExecutionChain.java:149)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:934)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.websocket.server.WsFilter.doFilter(WsFilter.java:52)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.microservice.transaction.server.filter.TopIdempotentFilter.doFilter(TopIdempotentFilter.java:80)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.microservice.transaction.server.filter.ResponseFilter.doFilter(ResponseFilter.java:42)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.filter.ParamsFitler.doFilter(ParamsFitler.java:89)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.interceptor.IflytekFilter.doFilter(IflytekFilter.java:55)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.alibaba.arms.filter.EagleEyeFilter.doFilter(EagleEyeFilter.java:24)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.microservice.transaction.server.filter.ResponseFilter.doFilter(ResponseFilter.java:42)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.microservice.transaction.server.filter.TopIdempotentFilter.doFilter(TopIdempotentFilter.java:80)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.interceptor.security.MonitorFilter.doFilter(MonitorFilter.java:97)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.interceptor.security.SecurityFilter.doFilter(SecurityFilter.java:107)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.yuan.security.acegi.TopFilterChainProxy.doFilter(TopFilterChainProxy.java:35)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.topsoft.session.TopnetSpringDelegatingFilterProxy.doFilter(TopnetSpringDelegatingFilterProxy.java:27)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ThorStandardWrapperValve.invoke(ThorStandardWrapperValve.java:202)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.StandardContextValve.invoke(StandardContextValve.java:242)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.twnt.thor.OpenEJBValve.invoke(OpenEJBValve.java:46)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.ThorStandardHostValve.invoke(ThorStandardHostValve.java:89)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.valves.AccessLogValve.invoke(AccessLogValve.java:929)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.core.StandardEngineValve.invoke(StandardEngineValve.java:154)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.thor.connector.CoyoteAdapter.service(CoyoteAdapter.java:411)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.oro.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1017)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.oro.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:594)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.webutil.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1788)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.webutil.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1765)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.webutil.util.threads.TWThreadPoolExecutor.runWorker(TWThreadPoolExecutor.java:1165)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at com.tongweb.web.webutil.util.threads.TWThreadPoolExecutor$Worker.run(TWThreadPoolExecutor.java:622)]
[2022-08-18 10:18:13] [WARNING] [System.out] [    at java.lang.Thread.run(Thread.java:745)]

解决方案:将obj判空,不为空的条件下再执行system.out.println()

相关文章

学习编程是顺着互联网的发展潮流,是一件好事。新手如何学习...
IT行业是什么工作做什么?IT行业的工作有:产品策划类、页面...
女生学Java好就业吗?女生适合学Java编程吗?目前有不少女生...
Can’t connect to local MySQL server through socket \'/v...
oracle基本命令 一、登录操作 1.管理员登录 # 管理员登录 ...
一、背景 因为项目中需要通北京网络,所以需要连vpn,但是服...