Websocket not starting when deployed

When starting a deployed war in jetty we see this and the app never starts

WARNING: Duplicate resource 0360c5cc-7c91-4c54-9e8f-9dee71bf85c8. Could be caused by a dead connection not detected by your server. Replacing the old one with the fresh one
Jan 22, 2018 7:49:55 PM org.atmosphere.cpr.DefaultBroadcaster addAtmosphereResource

This is the lines above it.

=================================================================
Vaadin depends on Atmosphere 2.4.5.vaadin2 but version 2.4.11.vaadin1 was found.
This might cause compatibility problems if push is used.

Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler
INFO: Installed AtmosphereHandler com.vaadin.server.communication.PushAtmosphereHandler mapped to context-path: /*
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler
INFO: Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.server.communication.PushAtmosphereHandler
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework autoConfigureService
INFO: Atmosphere is using org.atmosphere.util.VoidAnnotationProcessor for processing annotation
Jan 22, 2018 7:47:39 PM org.atmosphere.util.ForkJoinPool
INFO: Using ForkJoinPool java.util.concurrent.ForkJoinPool. Set the org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads to -1 to fully use its power.
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework initWebSocket
INFO: Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.DefaultAsyncSupportResolver newCometSupport
WARNING: Failed to create AsyncSupport class: class org.atmosphere.container.JSR356AsyncSupport, error: java.lang.reflect.InvocationTargetException
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.DefaultAsyncSupportResolver newCometSupport
SEVERE: Real error: Unable to configure jsr356 at that stage. ServerContainer is null
java.lang.IllegalStateException: Unable to configure jsr356 at that stage. ServerContainer is null
at org.atmosphere.container.JSR356AsyncSupport.(JSR356AsyncSupport.java:51)
at org.atmosphere.container.JSR356AsyncSupport.(JSR356AsyncSupport.java:40)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:237)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:308)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolve(DefaultAsyncSupportResolver.java:294)
at org.atmosphere.cpr.AtmosphereFramework.autoDetectContainer(AtmosphereFramework.java:2080)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:914)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:838)
at com.vaadin.server.communication.PushRequestHandler.initAtmosphere(PushRequestHandler.java:216)
at com.vaadin.server.communication.PushRequestHandler.(PushRequestHandler.java:84)
at com.vaadin.server.VaadinServletService.createRequestHandlers(VaadinServletService.java:53)
at com.vaadin.server.VaadinService.init(VaadinService.java:194)
at com.vaadin.server.VaadinServlet.createServletService(VaadinServlet.java:334)
at com.vaadin.server.VaadinServlet.init(VaadinServlet.java:228)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:612)
at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:468)
at org.eclipse.jetty.servlet.ServletHolder.ensureInstance(ServletHolder.java:763)
at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:748)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)

Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework configureAtmosphereInterceptor
INFO: Installing Default AtmosphereInterceptors
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response’s Headers Interceptor
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework configureAtmosphereInterceptor
INFO: Dropping Interceptor org.atmosphere.interceptor.HeartbeatInterceptor
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework configureAtmosphereInterceptor
INFO: Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor CORS Interceptor Support with priority FIRST_BEFORE_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor Default Response’s Headers Interceptor with priority AFTER_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor Browser Padding Interceptor Support with priority AFTER_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor Android Interceptor Support with priority AFTER_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor SSE Interceptor Support with priority AFTER_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor JSONP Interceptor Support with priority AFTER_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor Atmosphere JavaScript Protocol with priority AFTER_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor with priority AFTER_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor Browser disconnection detection with priority AFTER_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor org.atmosphere.interceptor.IdleResourceInterceptor with priority BEFORE_DEFAULT
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using EndpointMapper class org.atmosphere.util.DefaultEndpointMapper
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Broadcaster Shared List Resources: false
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Broadcaster Polling Wait Time 100
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Shared ExecutorService supported: true
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Messaging ExecutorService Pool Size unavailable - Not instance of ThreadPoolExecutor
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Async I/O Thread Pool Size: 200
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using AtmosphereResurceFactory: org.atmosphere.cpr.DefaultAtmosphereResourceFactory
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Invoke AtmosphereInterceptor on WebSocket message true
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: HttpSession supported: true
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Atmosphere is using org.atmosphere.inject.InjectableObjectFactory for dependency injection and object creation
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Atmosphere is using async support: org.atmosphere.container.NettyCometSupport running under container: jetty/9.2.13.v20150730
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Atmosphere Framework 2.4.11.vaadin1 started.
Jan 22, 2018 7:47:39 PM org.atmosphere.cpr.AtmosphereFramework addInterceptorToAllWrappers
INFO: Installed AtmosphereInterceptor Track Message Size Interceptor using | with priority BEFORE_DEFAULT
Jan 22, 2018 7:47:40 PM org.atmosphere.cpr.DefaultBroadcaster addAtmosphereResource

jetty-9.2.13.v20150730

Spring boot in eclipse works, but the issue is I need to load custom XML configuration files and does not seem to play well with spring boot.

Thanks that is a bit cryptic:

Is there an example for:

WebSocketServerContainerInitializer.configureContext(context); between server.setHandler(…) and server.start().

Hi, what happens before that?

The error message just says that a browser made a push connection, then the connection died and the browser reconnected. All this happened without the server knowing that the browser disconnected in between, for whatever possible reason.

Can probably be caused by many different things

Sounds like the server does not support or is not configured for JSR-356. What server is this?

From https://github.com/Atmosphere/atmosphere/issues/2090:

It only makes sense if you are starting the Jetty server from code. Otherwise you might be missing a jetty dependencies containing the websocket support

So I upgraded jetty to 9.4 and I saw this at the top of the log

=================================================================
Vaadin is running in DEBUG MODE.
Add productionMode=true to web.xml to disable debug features.
To show debug window, add ?debug to your application URL.

Jan 23, 2018 10:46:02 AM com.vaadin.server.VaadinService checkAtmosphereSupport
WARNING:

Vaadin depends on Atmosphere 2.4.5.vaadin2 but version 2.4.11.vaadin1 was found.
This might cause compatibility problems if push is used.