Including Customized Vaadin Code In Application


I’m not sure if I’m posting this in the right forum.

I believe that the Vaadin client-side code is too aggressive in session handeling. It simply gives up as soon as it a network issue is encountered. Due to this, we believe we are getting many dropped sessions in our Vaadin applications (with the Response.statusCode=0 “communication error - server down?”) when there’s a bad WiFi connection.

I looked at, and saw that as of the latest Vaadin version, doUidlRequest() does a singular retry after 100ms if it receives a status code 0 from the Response. So I have modified doUidlRequest() to retry 5 times instead, at successively greater wait intervals. Hence now the client side code retries 5 times over the course of 3 minutes total, before it actually gives up and kills the session. I based this behavior on the GMail webapp… if you’ve ever noticed, GMail in a desktop browser doesn’t simply just give up and drop the session when there’s a network issue, it retrys (infinitely) at successively greater wait intervals, until it’s able to get through.

Anyway, I had to jump through hoops to get my customized to compile into a widgetset and include it in one of our Vaadin applications. I’m not sure if I’m doing it the right way. Is there any documentation around on how to properly compile and include a customized Vaadin version in a Vaadin project/application?

I have the Vaadin root source tree downloaded from github and imported into Eclipse as a project. I made my modifications in there to I tried to include it in my Vaadin application project (which has its own custom widgetset configuration that includes the vaadin default widgetset) in several ways:

  1. Export the custom Vaadin project to a .jar and include it as an external library in our Vaadin application. When I try to compile the widgetset (using the eclipse Vaadin plugin), it complains the widgetset compiler cannot be found
  2. I included the Vaadin source folders as external folders in our Vaadin application build path. I added the client/src folder and client/shared folders, and it was able to compile the widgetset, HOWEVER, when running the application, it complains about a missing Vaadin bootstrap and the application doesn’t work in the browser.
  3. I got it to work finally in a very convoluted way: I added dependencies in Ivy for everything Vaadin related required to compile the widgetset. Ivy downloaded all the necessary jars. This is when I hijacked the vaadin-client-7.x.x.jar (in the ivy cache folder), deleted the factory compiled ApplicationConnection.class, and added my custom compiled ApplicationConnection.class into the downloaded .jar (lol, seriously, I had to get this to work somehow). I went on to compile the widgetset and it worked fine. Obviously this is not the right way to do it.

Any thoughts/ideas are appreciated. Thanks!