Hi
I am running Vaadin 7.7.6 on a Tomcat 8.5.8.
I have a UI annotated with @Push with Transport.WEBSOCKET.
My problem occurs after 900 seconds (15 minutes). What happens is that the websocket connection closes and the client log only shows:
“Websocket closed, reason: Normal closure; the connection successfully completed whatever purpose for which it was created.”
“Websocket closed normally”
Very thankful for any hint on where to begin my troubleshooting.
Have you tried using WEBSOCKET_XHR as transport instead of WEBSOCKET? You could also try adding ?debug=push to your application URL to see if there’s any more information to be had.
Sorry, I actually have WEBSOCKET_XHR.
I have debugging a little bit more now. I have two different UI’s. I am tracking the heartbeats. The heartbeat of the working UI is reaching the service method of the VaadinServlet but the heartbeat of the non working UI is not reaching the VaadinServlet. When debugging into the tomcat container the request is lost somewhere before it reaches the VaadinServlet. But as I said, ONLY for one of the UI classes and they are configured the same (in relevant aspects)
edit:
I used the ?debug=push and noticed this difference between the two UIs
Wokring UI: “Communication method: Client to server: XHR, server to client: websocket”
Non working UI: “Communication method: Client to server: XHR, server to client: -”
This also appear in the client console:
"
Response didn’t contain a server id. Please verify that the server is up-to-date and that the response data has not been modified in transmission."
Ok, you mean web.xml instead of annotations?
The woking ui is mapped to “application/” where as the non working ui is mapped to “application/permalink”.
Are they still suppose to use the same mapping for PUSH?
<init-param>
<param-name>pushmode</param-name>
<param-value>automatic</param-value> <!-- or whichever you want -->
</init-param>
<async-supported>true</async-supported>
for each .
That worked, thx. My problem now is that I map one servlet to /application and the other to /permalink and I also provide the different servlets with a UI via the init-param “ui”. Each UI is annotated with @SpringUI(path = “”). It seems like the UIs aren’t associated with the respective ui. When I start up, I get “No UIProvider has been added and there is no “UI” init parameter”. When I instead annotate the permalink UI with @SpringUI(path = “/permalink”) it works. But then I have to write localhost:8080/permalink/permalink to access that ui, i.e. first the servlet mapping and then the ui path. I want to be able to access the UIs via
localhost:8080/application and localhost:8080/permalink