NullPointerException -> Exception in push connection

Hello all,

I do not know why but unfortunately I have sometimes the following Exception in the logfile. Does anyone know what it the reason (something like a closed connection…) respectively I can fix it? In the browser no error occured…

Thanks in advance,
Thomas


2017-02-14 14:26:56,339 WARN | Atmosphere-Shared-AsyncOp-189 | org.atmosphere.cpr.AtmosphereResourceImpl | Exception during suspend() operation java.lang.NullPointerException
2017-02-14 14:26:56,339 ERROR | Atmosphere-Shared-AsyncOp-189 | com.vaadin.server.communication.PushAtmosphereHandler | Exception in push connection
java.lang.NullPointerException: null
2017-02-14 14:26:56,339 WARN | Atmosphere-Shared-AsyncOp-189 | org.atmosphere.cpr.AtmosphereResourceImpl | Listener error {}
java.lang.NullPointerException: null
2017-02-14 14:26:56,339 ERROR | Atmosphere-Shared-AsyncOp-189 | com.vaadin.server.communication.PushAtmosphereHandler | Exception in push connection
org.apache.catalina.connector.ClientAbortException: java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:340)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:303)
at org.apache.catalina.connector.Response.flushBuffer(Response.java:541)
at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:312)
at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:215)
at org.atmosphere.cpr.AtmosphereResponse.flushBuffer(AtmosphereResponse.java:485)
at org.atmosphere.cpr.AtmosphereInterceptorWriter.flush(AtmosphereInterceptorWriter.java:102)
at org.atmosphere.cpr.AtmosphereResponse$2.flush(AtmosphereResponse.java:589)
at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(AbstractReflectorAtmosphereHandler.java:149)
at com.vaadin.server.communication.PushAtmosphereHandler.onStateChange(PushAtmosphereHandler.java:52)
at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(DefaultBroadcaster.java:1096)
at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(DefaultBroadcaster.java:1116)
at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:921)
at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:522)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(Unknown Source)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.write(Unknown Source)
at sun.nio.ch.SocketChannelImpl.write(Unknown Source)
at org.apache.tomcat.util.net.SecureNioChannel.flush(SecureNioChannel.java:143)
at org.apache.tomcat.util.net.SecureNioChannel.write(SecureNioChannel.java:646)
at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101)
at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:157)
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doWrite(NioEndpoint.java:1221)
at org.apache.tomcat.util.net.SocketWrapperBase.flushBlocking(SocketWrapperBase.java:451)
at org.apache.tomcat.util.net.SocketWrapperBase.flush(SocketWrapperBase.java:441)
at org.apache.coyote.http11.Http11OutputBuffer.flushBuffer(Http11OutputBuffer.java:514)
at org.apache.coyote.http11.Http11OutputBuffer.flush(Http11OutputBuffer.java:243)
at org.apache.coyote.http11.Http11Processor.flush(Http11Processor.java:1495)
at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:284)
at org.apache.coyote.Response.action(Response.java:167)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:336)
… 18 common frames omitted

If this exception happens due closing of the browser by the user it is harmless. The reason it has been logged is that the server cannot know now whether the application in browser has crashed or it has been just closed. Also it may be possible that the communication pipeline between server and browser has been disconnected for some reason.

Thanks for the answer! is there a way to avoid writing this error to the logfile? Because it happens many times… :wink:

Hello all,

I think this Exception is the same cause and can also be ignored? But it would be great to have this error not in the logfile :slight_smile:

2017-02-15 14:36:13,540 WARN | Atmosphere-Shared-AsyncOp-43 | org.atmosphere.cpr.AtmosphereResourceImpl | Exception during suspend() operation java.lang.NullPointerException
2017-02-15 14:36:13,540 ERROR | Atmosphere-Shared-AsyncOp-43 | com.vaadin.server.communication.PushAtmosphereHandler | Exception in push connection
java.lang.NullPointerException: null
at org.apache.catalina.connector.Request.getServletContext(Request.java:1627)
at org.apache.catalina.connector.Request.getContextPath(Request.java:1984)
at org.apache.catalina.connector.RequestFacade.getContextPath(RequestFacade.java:784)
at javax.servlet.http.HttpServletRequestWrapper.getContextPath(HttpServletRequestWrapper.java:189)
at org.springframework.web.util.UrlPathHelper.getContextPath(UrlPathHelper.java:325)
at org.springframework.web.util.UrlPathHelper.getPathWithinApplication(UrlPathHelper.java:224)
at org.springframework.web.util.UrlPathHelper.getPathWithinServletMapping(UrlPathHelper.java:177)
at com.vaadin.spring.server.SpringVaadinServletRequest.getPathInfo(SpringVaadinServletRequest.java:68)
at org.atmosphere.cpr.AtmosphereRequest.getPathInfo(AtmosphereRequest.java:160)
at javax.servlet.http.HttpServletRequestWrapper.getPathInfo(HttpServletRequestWrapper.java:171)
at com.vaadin.server.ServletPortletHelper.hasPathPrefix(ServletPortletHelper.java:90)
at com.vaadin.server.ServletPortletHelper.isAppRequest(ServletPortletHelper.java:139)
at com.vaadin.server.VaadinServletService.isOtherRequest(VaadinServletService.java:169)
at com.vaadin.server.VaadinServletService.requestCanCreateSession(VaadinServletService.java:156)
at com.vaadin.server.VaadinService.findOrCreateVaadinSession(VaadinService.java:661)
at com.vaadin.server.VaadinService.findVaadinSession(VaadinService.java:530)
at com.vaadin.server.communication.PushHandler.connectionLost(PushHandler.java:323)
at com.vaadin.server.communication.PushAtmosphereHandler$AtmosphereResourceListener.onDisconnect(PushAtmosphereHandler.java:109)
at org.atmosphere.cpr.AtmosphereResourceImpl.onDisconnect(AtmosphereResourceImpl.java:714)
at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:617)
at org.atmosphere.cpr.AtmosphereResponse.handleException(AtmosphereResponse.java:922)
at org.atmosphere.cpr.AtmosphereResponse.flushBuffer(AtmosphereResponse.java:487)
at org.atmosphere.cpr.AtmosphereInterceptorWriter.flush(AtmosphereInterceptorWriter.java:102)
at org.atmosphere.cpr.AtmosphereResponse$2.flush(AtmosphereResponse.java:589)
at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(AbstractReflectorAtmosphereHandler.java:149)
at com.vaadin.server.communication.PushAtmosphereHandler.onStateChange(PushAtmosphereHandler.java:52)
at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(DefaultBroadcaster.java:1096)
at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(DefaultBroadcaster.java:1116)
at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:921)
at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:522)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Hello all,

does this mean that the only way is to avoid this message in the logfile to change the logelvel properties for this class?

Regards,
Thomas