Reputation: 51
I am struggling a lot with Vaadin 14 @Push.
The Vaadin app is running on wildfly 26, behind haproxy, nginx and then Cloudflare.
The problem is it looks like the websocket just get closed arbitrarily with the error:
It is not clear to me why the websocket is getting closed and have no idea how to trace this problem.
According to nginx one should have the following configuration which I have.
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
According to haproxy no additional configuration is necessary except for the tunnel timeout.
If I configure Push with long polling, it mostly works and then every so often I get a situation where the Vaadin comms gets into knots, throws errors, closes connections and reloads the page in infinite loops. This is an unrelated error and I cannot reproduce this in a basic test Vaadin app - it occurs in an app with literally hundreds of thousands of lines of code.
So I always try and go back to Push with websockets to get around the issue, but I cannot get the websocket option properly configured.
Here are some non-image examples of the error messages I get:
> Vaadin push loaded
> vaadin-3-2bc020d4b4b2d49fe3f7.cache.js:1 The custom element definition for "vaadin-text-area"
> was finalized before a style module was registered.
> Make sure to add component specific style modules before
> importing the corresponding custom element.
> n @ vaadin-3-2bc020d4b4b2d49fe3f7.cache.js:1
> vaadinPush-min.js:1 Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). -
> wasClean: false
> log @ vaadinPush-min.js:1
> vaadinPush-min.js:1 Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). -
> wasClean: false
> log @ vaadinPush-min.js:1
> warn @ vaadinPush-min.js:1
> ax.onclose @ vaadinPush-min.js:1
Upvotes: 0
Views: 521
Reputation: 17
i meet some problems about vaadin 14 push , and i set a system property of it , and then i fix it. you can try my code.
@Component
public class VaadinPushModeSet implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
System.setProperty("com.vaadin.flow.spring.pushMode","AUTOMATIC");
}
}
Upvotes: 0