vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
618 stars 167 forks source link

A filter or servlet of the current chain does not support asynchronous operations #19104

Open avdhootu27 opened 7 months ago

avdhootu27 commented 7 months ago

Description of the bug

I created a vaadin app and deployed it on aws linux and getting following error continuously: A filter or servlet of the current chain does not support asynchronous operations

However it worked fine on localhost. I am using @Push(transport = Transport.WEBSOCKET_XHR) and I haven't registered any servlet, I am using servlet created by vaadin. I am getting this error each time I update the UI. What is the reason behind this? Do I need to use ui.access() each time I update the UI?

Expected behavior

Should not get that error

Minimal reproducible example

@Push(transport = Transport.WEBSOCKET_XHR) Use vaadin's servlet, deploy on aws linux

Versions

TatuLund commented 7 months ago

Application Server (if applicable): Embeded tomcat

You need to set asyncSupported webinit param with Tomcat.

avdhootu27 commented 7 months ago

I didn't understand how to set asyncSupported webinit param with "Tomcat" I have seen that param with WebServlet annotation.

But according to official docs https://vaadin.com/docs/v14/flow/advanced/tutorial-push-configuration#push.configuration.servlet we should add async supported param when we are configuring your servlet manually, but I am not configuring servlet manually, I am using vaadin's autogenerated servlet. And if still I need to add that param, where should I add? because I saw few examples where this param is added and it was with WebServlet annotation on servlet class, and I am not having any of such class

mcollovati commented 7 months ago

It might not depend on Vaadin itself, but other servlet filters the application is using. You should double-check that all deployed filters support async.

avdhootu27 commented 6 months ago

I am getting same error again in safari browser. This time few push requests are getting success (200 status) and few are getting status 500. On chrome browser all is working fine. Now I upgraded to vaadin 24.3.10.