Jetty 9 and Vaadin 7 atmosphere issue

I am running Jetty 9.2.6 inside Eclipse with Vaadin 7.3.6 and get this error:



SEVERE: Failed to initialize Atmosphere Framework
java.lang.IllegalArgumentException: Unable to createclass org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket
at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:229)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:288)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.resolve(DefaultAsyncSupportResolver.java:274)
at org.atmosphere.cpr.AtmosphereFramework.autoDetectContainer(AtmosphereFramework.java:1591)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:717)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:614)
at com.vaadin.server.communication.PushRequestHandler.(PushRequestHandler.java:121)
at com.vaadin.server.VaadinServletService.createRequestHandlers(VaadinServletService.java:82)
at com.vaadin.server.VaadinService.init(VaadinService.java:186)
at com.vaadin.server.VaadinServlet.createServletService(VaadinServlet.java:258)
at com.vaadin.server.VaadinServlet.init(VaadinServlet.java:164)
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.handle(ServletHolder.java:778)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
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:1125)
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:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:313)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:626)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:546)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.reflect.InvocationTargetException
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:408)
at org.atmosphere.cpr.DefaultAsyncSupportResolver.newCometSupport(DefaultAsyncSupportResolver.java:225)
… 30 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/websocket/WebSocketFactory$Acceptor
at org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket.(JettyServlet30AsyncSupportWithWebSocket.java:46)
… 35 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.websocket.WebSocketFactory$Acceptor
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at org.eclipse.jetty.webapp.WebAppClassLoader.findClass(WebAppClassLoader.java:510)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:441)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)
… 36 more

I tried various settings for these parameters :



initParams = {
@WebInitParam(name = “org.atmosphere.useWebSocketAndServlet3”, value = “false”)/,
@WebInitParam(name = “org.atmosphere.cpr.asyncSupport”, value = “Jetty9WebSocketHandler”)
/
}

none of which helped.

I tried Jetty 8.1.4 but got the same error.

I don’t see org/eclipse/jetty/websocket/WebSocketFactory in the Jetty jar files.

Am I missing something?

Uh, the same issue with my new vaadin 14 project, it has to be something else …

Uh, the same issue with my new vaadin 14 project

It can’t be the same issue. Vaadin 14 does not work with Jetty 9.2 or 9.3 series, you need to have Jetty 9.4+

Solved,
I had a project dependency (jersey) that was bringing in jars from jetty server inside my war WEB-INF/libs, once i removed those extra jars the problem went away.
Jetty 9.4.20