Vaadin 7.1.14 - Session expired before push was disconnected. This should n

I just updated Vaadin to version 7.1.14.

Now i get this new Error Message twice in a row when a VaadinSession is closed:

Apr 25, 2014 10:06:30 AM com.vaadin.server.communication.PushHandler disconnect
Schwerwiegend: Session expired before push was disconnected. This should never happen
com.vaadin.server.SessionExpiredException
    at com.vaadin.server.VaadinService.doFindOrCreateVaadinSession(VaadinService.java:707)
    at com.vaadin.server.VaadinService.findOrCreateVaadinSession(VaadinService.java:642)
    at com.vaadin.server.VaadinService.findVaadinSession(VaadinService.java:501)
    at com.vaadin.server.communication.PushHandler.disconnect(PushHandler.java:399)
    at com.vaadin.server.communication.PushHandler.onResume(PushHandler.java:381)
    at org.atmosphere.cpr.AtmosphereResourceImpl.onResume(AtmosphereResourceImpl.java:817)
    at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:770)
    at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:748)
    at org.atmosphere.cpr.AtmosphereResourceImpl.resume(AtmosphereResourceImpl.java:297)
    at com.vaadin.server.communication.AtmospherePushConnection.disconnect(AtmospherePushConnection.java:232)
    at com.vaadin.ui.UI.setPushConnection(UI.java:1442)
    at com.vaadin.ui.UI.setSession(UI.java:423)
    at com.vaadin.server.VaadinSession.removeUI(VaadinSession.java:832)
    at com.vaadin.server.VaadinService$1$1.run(VaadinService.java:457)
    at com.vaadin.ui.UI.accessSynchronously(UI.java:1242)
    at com.vaadin.server.VaadinService$1.run(VaadinService.java:445)
    at com.vaadin.server.VaadinSession.accessSynchronously(VaadinSession.java:1251)
    at com.vaadin.server.VaadinService.fireSessionDestroy(VaadinService.java:440)
    at com.vaadin.server.VaadinService.cleanupSession(VaadinService.java:1141)
    at com.vaadin.server.VaadinService$4.run(VaadinService.java:1324)
    at com.vaadin.server.VaadinSession.accessSynchronously(VaadinSession.java:1251)
    at com.vaadin.server.VaadinService.requestEnd(VaadinService.java:1321)
    at com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:275)
    at com.vaadin.server.communication.PushHandler.onRequest(PushHandler.java:307)
    at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:260)
    at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:167)
    at org.atmosphere.container.TomcatWebSocketUtil.doService(TomcatWebSocketUtil.java:137)
    at org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket.service(Tomcat7AsyncSupportWithWebSocket.java:59)
    at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1464)
    at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:219)
    at org.atmosphere.websocket.DefaultWebSocketProcessor$2.run(DefaultWebSocketProcessor.java:183)
    at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101)
    at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:178)
    at org.atmosphere.websocket.DefaultWebSocketProcessor.invokeWebSocketProtocol(DefaultWebSocketProcessor.java:167)
    at org.atmosphere.container.TomcatWebSocketHandler.onTextMessage(TomcatWebSocketHandler.java:92)
    at org.apache.catalina.websocket.MessageInbound.onTextData(MessageInbound.java:78)
    at org.apache.catalina.websocket.StreamInbound.doOnTextData(StreamInbound.java:191)
    at org.apache.catalina.websocket.StreamInbound.onData(StreamInbound.java:139)
    at org.apache.coyote.http11.upgrade.UpgradeProcessor.upgradeDispatch(UpgradeProcessor.java:88)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

I am using “@Push” Annotation in my UI to enable Push. The Session is closed with this method:

VaadinSession.getCurrent().close();

I did not get the Error before v7.1.14. Do i have to close the Push Connection manually before closing a VaadinSession? If yes, how i do that?

It seems to be a regression in 7.1.14. Could you
open a new ticket
about the issue?

made a new ticket


http://dev.vaadin.com/ticket/13650

Problem still available in Vaadin 7.2.0

I´m using Wildfly8.1.0CR1 and when a Session automatically expires after timeout the exception occurs.

2014-06-03 16:15:35,558 SEVERE [com.vaadin.server.communication.PushHandler]
 (Atmosphere-Shared-AsyncOp-187) Session expired before push was disconnected. This should never happen: com.vaadin.server.SessionExpiredException
    at com.vaadin.server.VaadinService.findOrCreateVaadinSession(VaadinService.java:653) [vaadin-server-7.2.0.jar:7.2.0]

    at com.vaadin.server.VaadinService.findVaadinSession(VaadinService.java:516) [vaadin-server-7.2.0.jar:7.2.0]

    at com.vaadin.server.communication.PushHandler.disconnect(PushHandler.java:338) [vaadin-server-7.2.0.jar:7.2.0]

    at com.vaadin.server.communication.PushHandler.onThrowable(PushHandler.java:324) [vaadin-server-7.2.0.jar:7.2.0]

    at org.atmosphere.cpr.AtmosphereResourceImpl.onThrowable(AtmosphereResourceImpl.java:629) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]

    at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:589) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]

    at org.atmosphere.cpr.DefaultBroadcaster.onException(DefaultBroadcaster.java:1097) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]

    at org.atmosphere.cpr.DefaultBroadcaster.onException(DefaultBroadcaster.java:1083) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]

    at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(DefaultBroadcaster.java:1021) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]

    at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(DefaultBroadcaster.java:1038) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]

    at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:879) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]

    at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:520) [atmosphere-runtime-2.1.2.vaadin2.jar:2.1.2.vaadin2]

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_51]

    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_51]

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]

    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]

Problem also on Wildfly 8.1.0CR2 and 8.1.0Final

I wonder if this error is the same? it occurs soon after a browser window is closed, possibly when a push message is sent to the UI prior to the heartbeat expiring the session. Or maybe it is when the session expires after missing the 3 heartbeats? This one on 7.2.1, Tomcat 8.0.8.

Jun 06, 2014 10:45:09 PM com.vaadin.server.communication.PushHandler onThrowable
SEVERE: Exception in push connection
java.io.IOException: AtmosphereResource Cancelled: a1615efa-cf03-4a0c-8f08-7ea478de3ecc
    at org.atmosphere.cpr.AtmosphereResponse.validAsyncIOWriter(AtmosphereResponse.java:459)
    at org.atmosphere.cpr.AtmosphereResponse.access$1100(AtmosphereResponse.java:55)
    at org.atmosphere.cpr.AtmosphereResponse$2.write(AtmosphereResponse.java:499)
    at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(AbstractReflectorAtmosphereHandler.java:141)
    at com.vaadin.server.communication.PushHandler$1.onStateChange(PushHandler.java:62)
    at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(DefaultBroadcaster.java:1018)
    at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(DefaultBroadcaster.java:1038)
    at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:879)
    at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:520)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Jun 06, 2014 10:45:09 PM com.vaadin.server.communication.PushHandler disconnect
SEVERE: Could not get UI. This should never happen

We are about to turn off push again because we have seen our Linux server crash repeatedly since introducing it.

We are running on Vaadin 7.3.6 on Tomcat 8.0.15 on Java 1.8.0_25 on CentOS 6.4.

We noted several exceptions like these around the time just before the crash, which our thought being that perhaps sockets or the like are not being closed correctly so we eventually run out of thread/openfile resources.

Dec 16, 2014 12:16:33 PM com.vaadin.server.communication.PushHandler onThrowable
SEVERE: Exception in push connection
java.io.IOException: AtmosphereResource Cancelled: edd1f327-60c8-4dcb-87cb-d2ee3a5237ff
        at org.atmosphere.cpr.AtmosphereResponse.validAsyncIOWriter(AtmosphereResponse.java:459)
        at org.atmosphere.cpr.AtmosphereResponse.access$1100(AtmosphereResponse.java:55)
        at org.atmosphere.cpr.AtmosphereResponse$2.write(AtmosphereResponse.java:499)
        at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(AbstractReflectorAtmosphereHandler.java:141)
        at com.vaadin.server.communication.PushHandler$1.onStateChange(PushHandler.java:63)
        at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(DefaultBroadcaster.java:1018)
        at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(DefaultBroadcaster.java:1038)
        at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:879)
        at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:520)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Dec 16, 2014 12:16:33 PM com.vaadin.server.communication.PushHandler disconnect
SEVERE: Session expired before push was disconnected. This should never happen
com.vaadin.server.SessionExpiredException
        at com.vaadin.server.VaadinService.findOrCreateVaadinSession(VaadinService.java:659)
        at com.vaadin.server.VaadinService.findVaadinSession(VaadinService.java:522)
        at com.vaadin.server.communication.PushHandler.disconnect(PushHandler.java:351)
        at com.vaadin.server.communication.PushHandler.onThrowable(PushHandler.java:337)
        at org.atmosphere.cpr.AtmosphereResourceImpl.onThrowable(AtmosphereResourceImpl.java:629)
        at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:589)
        at org.atmosphere.cpr.DefaultBroadcaster.onException(DefaultBroadcaster.java:1097)
        at org.atmosphere.cpr.DefaultBroadcaster.onException(DefaultBroadcaster.java:1083)
        at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(DefaultBroadcaster.java:1021)
        at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(DefaultBroadcaster.java:1038)
        at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:879)
        at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:520)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)




Dec 16, 2014 12:34:06 PM org.atmosphere.container.JSR356Endpoint onError
SEVERE:
java.io.IOException: java.util.concurrent.TimeoutException
        at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:276)
        at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:536)
        at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:464)
        at org.apache.tomcat.websocket.WsSession.close(WsSession.java:441)
        at org.apache.tomcat.websocket.WsSession.close(WsSession.java:435)
        at org.atmosphere.container.version.JSR356WebSocket.close(JSR356WebSocket.java:104)
        at org.atmosphere.websocket.WebSocket.close(WebSocket.java:264)
        at org.atmosphere.cpr.AtmosphereResponse.close(AtmosphereResponse.java:836)
        at org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:720)
        at org.atmosphere.cpr.AtmosphereResourceImpl.close(AtmosphereResourceImpl.java:785)
        at com.vaadin.server.communication.AtmospherePushConnection.disconnect(AtmospherePushConnection.java:294)
        at com.vaadin.server.communication.PushHandler.disconnect(PushHandler.java:430)
        at com.vaadin.server.communication.PushHandler.onDisconnect(PushHandler.java:330)
        at org.atmosphere.cpr.AtmosphereResourceImpl.onDisconnect(AtmosphereResourceImpl.java:663)
        at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:582)
        at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:564)
        at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:426)
        at org.atmosphere.interceptor.OnDisconnectInterceptor.inspect(OnDisconnectInterceptor.java:64)
        at org.atmosphere.cpr.AsynchronousProcessor.invokeInterceptors(AsynchronousProcessor.java:280)
        at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:146)
        at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:95)
        at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
        at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)
        at com.vaadin.server.communication.PushRequestHandler.handleRequest(PushRequestHandler.java:144)
        at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1406)
        at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:613)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.TimeoutException

We did eventually note just such a memory/resource issue, showing that Tomcat may be the root cause related to push sockets or the like not being closed or handled correctly when exceptions arise.

16-Dec-2014 12:43:01.274 SEVERE [http-nio-8443-ClientPoller-0]
 org.apache.tomcat.util.net.NioEndpoint$Poller.run
 java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:714)
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950)
        at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1368)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:161)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:141)
        at org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:627)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.processKey(NioEndpoint.java:1129)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1087)
        at java.lang.Thread.run(Thread.java:745)

Has this been resolved since?
Thanks

Any Updates.
I’m still getting this behavior using Vaddin 7.3.7 on tomcat 7 and tomcat 8.

Thanks & Regards,
Dany

I’m having the same problem, Tomcat 8 and Vaadin 7.4.0

Hello all, sorry about the lack of an official reply until now .

According to our analysis, this message has probably always been a false alarm; there should be no ill effects besides the log spam. The logging call was downgraded from SEVERE to FINER in 7.4.3; the relevant ticket is
#15220
.

Sorry for the inconvenience.