Websocket protocol not supported

Hi,
I have just upgraded to Vaadin 24.4.11 using Jetty 11.0.24.
I get this warning in the log

AsynchronousProcessor |WARN |Websocket protocol not supported

Any hints about what the problem can be?

Embedded Jetty? Maybe the websocket-jetty-server module is missing?

Actually websocket-jetty-server is there. Any other hint?

Hard to say without additional information. Can you share the project or a reproducible example?

I cannot provide a reproducible example.
I have debugged a bit and I have noticed that in the org.atmosphere.util.Utils class, the condition boolean allowWebSocketWithoutHeaders = request.getHeader(HeaderConfig.X_ATMO_WEBSOCKET_PROXY) != null;
returns false but I am not sure from where it comes or what should I do to fix it …

we have configured
our AppShellConfigurator with

@Push(value = PushMode.AUTOMATIC, transport = Transport.WEBSOCKET)

Some logging, maybe you can see something there:

2024-10-09 10:10:48,762|AtmosphereFramework           |INFO |Installed AtmosphereHandler com.vaadin.flow.server.communication.PushAtmosphereHandler mapped to context-path: /*
2024-10-09 10:10:48,762|AtmosphereFramework           |INFO |Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.flow.server.communication.PushAtmosphereHandler
2024-10-09 10:10:48,775|AtmosphereFramework           |INFO |Atmosphere is using org.atmosphere.util.VoidAnnotationProcessor for processing annotation
2024-10-09 10:10:48,776|AtmosphereFramework           |DEBUG|Scanning all classes on the classpath
2024-10-09 10:10:48,783|AtmosphereFramework           |INFO |Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol 
2024-10-09 10:10:48,784|DefaultAsyncSupportResolver   |DEBUG|Found jakarta.servlet.AsyncListener
2024-10-09 10:10:48,785|DefaultAsyncSupportResolver   |DEBUG|Found jakarta.servlet.AsyncListener
2024-10-09 10:10:48,786|AtmosphereFramework           |INFO |Installing Default AtmosphereInterceptors
2024-10-09 10:10:48,787|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
2024-10-09 10:10:48,787|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
2024-10-09 10:10:48,787|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
2024-10-09 10:10:48,787|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
2024-10-09 10:10:48,788|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
2024-10-09 10:10:48,788|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
2024-10-09 10:10:48,788|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
2024-10-09 10:10:48,789|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
2024-10-09 10:10:48,789|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
2024-10-09 10:10:48,789|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
2024-10-09 10:10:48,789|AtmosphereFramework           |INFO |	org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
2024-10-09 10:10:48,789|AtmosphereFramework           |INFO |Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
2024-10-09 10:10:48,789|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor CORS Interceptor Support with priority FIRST_BEFORE_DEFAULT 
2024-10-09 10:10:48,791|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor Default Response's Headers Interceptor with priority AFTER_DEFAULT 
2024-10-09 10:10:48,791|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor Browser Padding Interceptor Support with priority AFTER_DEFAULT 
2024-10-09 10:10:48,791|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor Android Interceptor Support with priority AFTER_DEFAULT 
2024-10-09 10:10:48,791|HeartbeatInterceptor          |INFO |HeartbeatInterceptor configured with padding value 'X', client frequency 0 seconds and server frequency 60 seconds
2024-10-09 10:10:48,791|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor Heartbeat Interceptor Support with priority AFTER_DEFAULT 
2024-10-09 10:10:48,791|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor SSE Interceptor Support with priority AFTER_DEFAULT 
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor JSONP Interceptor Support with priority AFTER_DEFAULT 
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor Atmosphere JavaScript Protocol with priority AFTER_DEFAULT 
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor with priority AFTER_DEFAULT 
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor Browser disconnection detection with priority AFTER_DEFAULT 
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor org.atmosphere.interceptor.IdleResourceInterceptor with priority BEFORE_DEFAULT 
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Using EndpointMapper class org.atmosphere.util.DefaultEndpointMapper
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Broadcaster Shared List Resources: false
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Broadcaster Polling Wait Time 100
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Shared ExecutorService supported: true
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Messaging Thread Pool Size: 10
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Async I/O Thread Pool Size: 10
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Using AtmosphereResurceFactory: org.atmosphere.cpr.DefaultAtmosphereResourceFactory
2024-10-09 10:10:48,792|AtmosphereFramework           |INFO |Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
2024-10-09 10:10:48,793|AtmosphereFramework           |INFO |Invoke AtmosphereInterceptor on WebSocket message true
2024-10-09 10:10:48,793|AtmosphereFramework           |INFO |HttpSession supported: true
2024-10-09 10:10:48,793|AtmosphereFramework           |INFO |Atmosphere is using DefaultAtmosphereObjectFactory for dependency injection and object creation
2024-10-09 10:10:48,793|AtmosphereFramework           |INFO |Atmosphere is using async support: org.atmosphere.container.Servlet30CometSupport running under container: jetty/11.0.24 using jakarta.servlet/3.0
2024-10-09 10:10:48,793|AtmosphereFramework           |INFO |Atmosphere Framework 3.0.5.slf4jvaadin1 started.
2024-10-09 10:10:48,797|AtmosphereFramework           |INFO |Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT 

2024-10-09 10:10:54,076|AsynchronousProcessor         |WARN |Websocket protocol not supported
2024-10-09 10:10:59,147|AsynchronousProcessor         |WARN |Websocket protocol not supported

At least this log is suspicious

Atmosphere is using async support: org.atmosphere.container.Servlet30CometSupport running under container: jetty/11.0.24 using jakarta.servlet/3.0

I woudl put a breakpoint in DefaultAsyncSupportResolver.resolve() to find out why JSR356AsyncSupport is not detected.

Two possible reasons:

  • jakarta.websocket.Endpoint class is not found in classpath
  • org.atmosphere.websocket.suppressJSR356 init paramter is set to true

I added the missing libraries. Now I’m into this logging message :

2024-10-09 12:07:43,093|DefaultAsyncSupportResolver   |WARN |Failed to create AsyncSupport class: class org.atmosphere.container.JSR356AsyncSupport, error: java.lang.reflect.InvocationTargetException

Most likely some missing configuration. You can check if you are facing this issue Websocket fails with Vaadin 24 and Jetty 12 · Issue #17244 · vaadin/flow · GitHub

Yes, I agree that there is some glue missing. Unfortunately the link that you sent is for Jetty 12, I’m using 11.

There’s also the same example project in branch 11.0.x. Maybe that could help

Thank you, I got it finally: :champagne:

Atmosphere is using async support: org.atmosphere.container.JSR356AsyncSupport running under container: jetty/11.0.24 using jakarta.servlet/3.0 and jsr356/WebSocket API

There was no missing configuration, but some missing library:

            <dependency>
                <groupId>org.eclipse.jetty.websocket</groupId>
                <artifactId>websocket-jakarta-server</artifactId>
            </dependency>

it was confusing because there was no error message besides of that warning:

AsynchronousProcessor |WARN |Websocket protocol not supported

Debugging the DefaultAsyncSupportResolver.resolve() was crucial.

Thank you once more!