PUSH 7.5.1 with jetty Embedded 9.2.1.v20140609

Hi

We were using PUSH release 7.4.8 with jetty Embedded 9.2.1.v20140609, but when we migrate to 7.5.1 we cannot navigate, as long you click something the loading icon appear on top left and the UI does not response any more but we don’t have any log error as well. If we disable PUSH it is possible to navigate.

We found this issue reported, looks like it is fixed but it is not.

https://dev.vaadin.com/ticket/14381

Also I tryed to do what is in the ticket but does not work,
Do you have any additional reference regarding this issue?

What potential errors do you see in
a) the browser console (when using ?debug)
b) the server log (running the server with assertions enabled: -ea)

You could also try to force your application to use JSR-356 by adding a servlet init parameter

 <init-param>
  <param-name>org.atmosphere.cpr.asyncSupport</param-name>
  <param-value>org.atmosphere.container.JSR356AsyncSupport</param-value>
</init-param>

Hi Artur,
Thank you for your reply, regarding this issue it was related to …/VAADIN/widgetsets because it was wrong built. Just building using 7.5.1 works for the issue I had.

But sometimes when you reload or close the UI in the browser we have the following error. It does not happen all time.


Jul 13, 2015 6:22:20 PM org.atmosphere.cpr.AsynchronousProcessor completeLifecycle
SEVERE: Failed to cancel resource: a6582242-559d-4eb5-a5e1-95b02f3551bf
java.lang.RuntimeException: org.eclipse.jetty.io.EofException: Closed

Some feedback:

  • We need to use
    IE9

  • We are using
    Push Manual
    mode

  • log from …?debug
    1968ms Establishing push connection
    1970ms Push connection using primary method
    (websocket) failed. Trying with long-polling


    2068ms Push connection established using
    long-polling

  • I tried to set the parameter you mentioned, but it does not find the class javax/websocket/DeploymentException, it is not included in the embedded jetty and in the SE1.7 because it is part of EE. But maybe If it is using long-polling because it is IE9 maybe the issue in the logs is for other reason. Do you have any other reference related this error?


Jul 13, 2015 6:22:20 PM org.atmosphere.cpr.AsynchronousProcessor completeLifecycle
SEVERE: Failed to cancel resource: a6582242-559d-4eb5-a5e1-95b02f3551bf
java.lang.RuntimeException: org.eclipse.jetty.io.EofException: Closed
at org.atmosphere.cpr.AtmosphereResponse.write(AtmosphereResponse.java:1023)
at org.atmosphere.cpr.AtmosphereResponse.write(AtmosphereResponse.java:988)
at org.atmosphere.cpr.AtmosphereInterceptorWriter.writeReady(AtmosphereInterceptorWriter.java:92)
at org.atmosphere.cpr.AtmosphereInterceptorWriter.invokeInterceptor(AtmosphereInterceptorWriter.java:83)
at org.atmosphere.cpr.AtmosphereInterceptorWriter.write(AtmosphereInterceptorWriter.java:69)
at org.atmosphere.cpr.AtmosphereInterceptorWriter.write(AtmosphereInterceptorWriter.java:64)
at org.atmosphere.cpr.AtmosphereResponse$2.write(AtmosphereResponse.java:552)
at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(AbstractReflectorAtmosphereHandler.java:148)
at com.vaadin.server.communication.PushAtmosphereHandler.onStateChange(PushAtmosphereHandler.java:51)
at org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:509)
at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:459)
at org.atmosphere.interceptor.OnDisconnectInterceptor.inspect(OnDisconnectInterceptor.java:77)
at org.atmosphere.cpr.AsynchronousProcessor.invokeInterceptors(AsynchronousProcessor.java:312)
at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:169)
at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:107)
at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
at org.atmosphere.container.Jetty9AsyncSupportWithWebSocket.service(Jetty9AsyncSupportWithWebSocket.java:170)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2075)
at com.vaadin.server.communication.PushRequestHandler.handleRequest(PushRequestHandler.java:226)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1408)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:350)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at net.sourceforge.spnego.SpnegoHttpFilter.doFilter(SpnegoHttpFilter.java:250)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.eclipse.jetty.io.EofException: Closed
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:325)
at java.io.OutputStream.write(OutputStream.java:75)
at org.atmosphere.cpr.AtmosphereResponse.write(AtmosphereResponse.java:1014)
… 42 more

Hi Artur,
What I found is that using Push with long-polling and execute JavaScripts create conflicts.

Like workaround when the call of the java script is executed I need to disable push and enable again at the end as you can see in the example below, otherwise I have the error mentioned before.

You can see in the example with this javascript to detect when the browser is close.
Do you have any reference about that? Shall I open a ticket?


JavaScript.getCurrent().execute(“window.onbeforeunload = function (e) { var e = e || window.event; aboutToClose(); return; };”);

JavaScript.getCurrent().addFunction(“aboutToClose”, new JavaScriptFunction() {
@Override
public void call(JsonArray arguments) {
PushMode
pushMode
= UI.getCurrent().getPushConfiguration().getPushMode();
UI.getCurrent().getPushConfiguration().setPushMode(
PushMode.DISABLED
);


… do stuff


UI.getCurrent().getPushConfiguration().
setPushMode(pushMode);

}
});
}

If I remember correctly, Atmosphere disconnects the push channel in onbeforeunload. If you are doing server communication at that stage, you might have a timing issue with Atmosphere or it just might be that the push channel has been closed already when you try to use it.