Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vaadin UI detaches after some time

Tags:

java

push

vaadin

I'm using Vaadin 7.1.2 and rely heavily on its push notification support. Everything works well for some time after the application starts, but then after about 30-40 minutes suddenly it stops pushing updates from the server and instead logs com.vaadin.ui.UIDetachedException on every update event. Restart helps but for very long.

All configuration parameters are default except I had to add the -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true command options for push to work.

I deploy to Tomcat 7.0.36 and everything is set to default in its configuration as well.

To update UI I simply call

ui.access(new Runnable{...});

on the UI instance which I pass down to every component from the UI.init() method.

Am I missing something?

like image 431
Kovalsky Avatar asked Nov 12 '22 22:11

Kovalsky


1 Answers

Does it happen when the application is idle (e.g. you do nothing in the app) or no matter if user is active? It might be that the user session is invalidated by Tomcat after half an hour of inactivity from the client side, and that's why your UI is detached. If that's not the case please consider upgrading to latest Vaadin, which is 7.1.8 right now. Lots of issues with push have been resolved lately.

like image 51
Maciej Piotr Przepióra Avatar answered Nov 14 '22 23:11

Maciej Piotr Przepióra