Vaadin 7.2.3 and Tomcat 8.0.9 atmosphere

I’ve just upgraded my project to:
Vaadin 7.2.3
Java 8
Tomcat 8.0.9
(yes I like to live on the edge).

When I start my application, Atmosphere is trying to load the Jetty Comet support rather than tomcat 8 support.

Looking through the Atmosphere code the problem appears to be that there is no explict support for tomcat 8 so it just grabs the first container.

I can see that Vaadin is using Atmosphere 2.1.2 which from what I can tell supports tomcat 8, however the call to
org.atmosphere.cpr.DefaultAsyncSupportResolver.resolveWebSocket(DefaultAsyncSupportResolver.java:288)

essentially fails as follows

The call to detectWebSocketPresent has useServlet30Async = true and useNativeIfPossible = false

The call if (testClassExists(TOMCAT_WEBSOCKET)) fails
The call to if (testClassExists(JETTY_8)) succeeds
The call to if (testClassExists(JSR356_WEBSOCKET)) succeeds.

The failure seems to stem from the fact that class
TOMCAT_WEBSOCKET = org.apache.coyote.http11.upgrade.UpgradeInbound
doesn’t exist is tomcat 8.0.9.

My web.xml file is below.

Any ideas as to what I’ve done wrong here?

The atmostphere logs are:

Jun 30, 2014 10:46:14 PM org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler
INFO: Installed AtmosphereHandler com.vaadin.server.communication.PushHandler$1 mapped to context-path: /*
Jun 30, 2014 10:46:14 PM org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler
INFO: Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.server.communication.PushHandler$1
Jun 30, 2014 10:46:14 PM org.atmosphere.cpr.AtmosphereFramework doInitParams
WARNING: SessionSupport error. Make sure you define org.atmosphere.cpr.SessionSupport as a listener in web.xml instead
Jun 30, 2014 10:46:14 PM org.atmosphere.cpr.AtmosphereFramework autoConfigureService
INFO: Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
Jun 30, 2014 10:46:14 PM org.atmosphere.cpr.DefaultAnnotationProcessor configure
INFO: AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$ServletContainerInitializerAnnotationProcessor being used
Jun 30, 2014 10:46:14 PM org.atmosphere.cpr.DefaultAnnotationProcessor fallbackToManualAnnotatedClasses
WARNING: Unable to detect annotations. Application may fail to deploy.
Jun 30, 2014 10:46:14 PM org.atmosphere.cpr.AtmosphereFramework autoDetectWebSocketHandler
INFO: Auto detecting WebSocketHandler in /WEB-INF/classes/
Jun 30, 2014 10:46:16 PM org.atmosphere.cpr.AtmosphereFramework initWebSocket
INFO: Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol

Web.xml

 <?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.1"
    xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd">
    <display-name>Vaadin Web Application</display-name>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>


    <!-- context-param> <param-name>vaadin.theme</param-name> <param-value>scoutmaster</param-value>
        </context-param -->

    <listener>
        <listener-class>au.org.scoutmaster.application.ContextListener
        </listener-class>
    </listener>

    <listener>
        <listener-class>au.org.scoutmaster.application.LocalEntityManagerContextListener
        </listener-class>
    </listener>

    <listener>
        <listener-class>au.org.scoutmaster.application.SessionListener
        </listener-class>
    </listener>

    <!-- per request Entity Manager injection -->
    <filter>
        <filter-name>EntityManagerInjectorFilter</filter-name>
        <filter-class>au.com.vaadinutils.servlet.EntityManagerInjectorFilter
        </filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>EntityManagerInjectorFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- Vaadin servlet - where the action happens -->
    <servlet>
        <servlet-name>Scoutmaster Private Application Servlet</servlet-name>
        <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
        <init-param>
            <description>Scoutmaster Private UI</description>
            <param-name>UI</param-name>
            <param-value>au.org.scoutmaster.application.NavigatorUI</param-value>
        </init-param>
        <init-param>
            <param-name>org.atmosphere.cpr.AtmosphereInterceptor</param-name>
            <!-- comma-separated list of fully-qualified class names -->
            <param-value>au.com.vaadinutils.servlet.AtmosphereFilter
            </param-value>
        </init-param>
        <async-supported>true</async-supported>
    </servlet>

    <!-- Vaadin servlet - this is the public interface -->
    <servlet>
        <servlet-name>Scoutmaster Public Application Servlet</servlet-name>
        <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
        <init-param>
            <description>Scoutmaster Public UI</description>
            <param-name>UI</param-name>
            <param-value>au.org.scoutmaster.application.PublicUI</param-value>
        </init-param>
        <init-param>
            <param-name>org.atmosphere.cpr.AtmosphereInterceptor</param-name>
            <!-- comma-separated list of fully-qualified class names -->
            <param-value>au.com.vaadinutils.servlet.AtmosphereFilter
            </param-value>
        </init-param>
        <async-supported>true</async-supported>
    </servlet>
    
    <servlet>
        <servlet-name>ImageServlet</servlet-name>
        <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet
        </servlet-class>
    </servlet>
    
    <servlet-mapping>
        <servlet-name>ImageServlet</servlet-name>
        <url-pattern>/images</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Scoutmaster Public Application Servlet</servlet-name>
        <url-pattern>/public/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Scoutmaster Private Application Servlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

</web-app>

I’m having the same problem, on Tomcat 8.0.9 and Vaadin 7.2.4.
This is the stacktrace, no prior errors or warnings:

[code]
[11:48:05]
INFO org.apache.catalina.startup.Catalina start - Server startup in 50125 ms
[11:48:09]
WARNING com.vaadin.server.DefaultDeploymentConfiguration checkProductionMode -

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.

[11:48:09]
INFO org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler - Installed AtmosphereHandler com.vaadin.server.communication.PushHandler$1 mapped to context-path: /*
[11:48:09]
INFO org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler - Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.server.communication.PushHandler$1
[11:48:09]
INFO org.atmosphere.cpr.AtmosphereFramework autoConfigureService - Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
[11:48:09]
INFO org.atmosphere.cpr.DefaultAnnotationProcessor configure - AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$ServletContainerInitializerAnnotationProcessor being used
[11:48:09]
WARNING org.atmosphere.cpr.DefaultAnnotationProcessor fallbackToManualAnnotatedClasses - Unable to detect annotations. Application may fail to deploy.
[11:48:09]
INFO org.atmosphere.cpr.AtmosphereFramework autoDetectWebSocketHandler - Auto detecting WebSocketHandler in /WEB-INF/classes/
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework initWebSocket - Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework configureAtmosphereInterceptor - Installing Default AtmosphereInterceptor
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response’s Headers Interceptor
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework newAInterceptor - org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework configureAtmosphereInterceptor - Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Using EndpointMapper class org.atmosphere.util.DefaultEndpointMapper
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Broadcaster Polling Wait Time 100
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Shared ExecutorService supported: true
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Messaging Thread Pool Size: Unlimited
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Async I/O Thread Pool Size: 200
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - HttpSession supported: true
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Atmosphere is using DefaultAtmosphereObjectFactory for dependency injection and object creation
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Atmosphere is using async support: org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket running under container: Apache Tomcat/8.0.9 with WebSocket enabled.
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework info - Atmosphere Framework 2.1.2.vaadin2 started.
[11:48:10]
INFO org.atmosphere.cpr.AtmosphereFramework interceptor - Installed AtmosphereInterceptor Track Message Size Interceptor using | with priority BEFORE_DEFAULT
11:48:59 INFO Application:61 - Initializing UI
11:48:59 DEBUG LoginView:104 - LoginView postConstruct done!
[11:49:04]
SEVERE com.vaadin.server.DefaultErrorHandler doDefault -
java.lang.NullPointerException
at org.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory.java:238)
at org.eclipse.jetty.websocket.WebSocketFactory.acceptWebSocket(WebSocketFactory.java:396)
at org.atmosphere.container.JettyWebSocketUtil.doService(JettyWebSocketUtil.java:60)
at org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket.service(JettyServlet30AsyncSupportWithWebSocket.java:52)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)
at com.vaadin.server.communication.PushRequestHandler.handleRequest(PushRequestHandler.java:143)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1405)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:237)
at fi.invian.domacare2.web.security.DCVaadinServlet.service(DCVaadinServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:744)

[11:49:04]
SEVERE org.apache.catalina.core.StandardWrapperValve invoke - Servlet.service() for servlet [Vaadin Application Servlet]
in context with path
[/DC2_WEB] threw exception [com.vaadin.server.ServiceException: java.lang.NullPointerException]
with root cause
java.lang.NullPointerException
at org.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory.java:238)
at org.eclipse.jetty.websocket.WebSocketFactory.acceptWebSocket(WebSocketFactory.java:396)
at org.atmosphere.container.JettyWebSocketUtil.doService(JettyWebSocketUtil.java:60)
at org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket.service(JettyServlet30AsyncSupportWithWebSocket.java:52)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1802)
at com.vaadin.server.communication.PushRequestHandler.handleRequest(PushRequestHandler.java:143)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1405)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:237)
at fi.invian.domacare2.web.security.DCVaadinServlet.service(DCVaadinServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:744)
[/code]It’s obvious Atmosphere is trying to use a Jetty connector.
For debugging purposes I replaced the vaadin-specific atmosphere and tried with
org.atmosphere:atmosphere-runtime:2.2.0-RC3 and got the same error chain.

Greetings,

I’m having the same problem, on Tomcat 8.0.9/7.0.54 and Vaadin 7.3.0.beta1. UI is annoted:

@PreserveOnRefresh @Push(transport = Transport.LONG_POLLING) Every time when I do first refresh page, NPE exception is catched.

Hi all, thanks for the reports.

AFAIK Tomcat 8 dropped their proprietary WebSocket support in favor of the standard JSR 356 WebSocket implementation. So it seems the TOMCAT_WEBSOCKET test fails as it should. The JSR356_WEBSOCKET test succeeds as it should, and it should be the
only
test that succeeds. Unfortunately, it seems in these cases that there’s also a Jetty implementation somewhere on the classpath and it’s preferred (the resolveWebSocket method simply takes the first element in the list of supported classes returned by detectWebSocketPresent.

I think Atmosphere should always prefer the JSR implementation unless
useNativeIfPossible
is true. However, in a normal situation there should not be any Jetty 8 stuff deployed if you run on Tomcat - the vaadin-uitest and vaadin-client-compiler modules both depend on Jetty 8 but neither should be deployed normally. You’ll probably also want to check whether your application itself deploys Jetty 8 for some reason.

With Jetty 8 application works perfectly.

Thanks for the pointer Johannes, after moving jetty dependencies to test scope this issue is fixed for me.

So just an update on this one.
With some digging I found that the problem was being caused by the ‘vaadin-client-compiler’ which has dependancies on jetty-annotations which in turn pulls in the full jetty servlet engine.

One question is why does the vaaden-client-compiler have a dependancy on jetty annotations in the first place?

Anyway the solution was to exclude each of the jetty dependancies. As yet I’m not certain if this will have an impact when we next try to compile the vaadin client components.

<dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiler</artifactId>
            <version>${vaadin.version}</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>jetty-annotations</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-plus</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-webapp</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-servlets</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jetty-util</artifactId>
                    <groupId>org.eclipse.jetty</groupId>
                </exclusion>
            </exclusions>
        </dependency>

Hi Brett,

As I mentioned in my previous reply, the preferred solution is to not deploy vaadin-client-compiler on the server. The reason for the strange-sounding dependency is that the gwt-dev module bundles a Jetty development server. Of course when writing Vaadin applications instead of pure GWT apps its usefulness is rather limited. Maybe we could add some exclusions to our build scripts but that would be a rather fragile approach.

The inclusion of the compiler module is perhaps due to my only basic knowledge of maven.

I’ve a single pom that I use to build the war and generate the compiled client components.
This requires that I included the vaadin-client-compiler in the pom dependancy tree.

I’ve googled but I can’t find any way of excluding the vaading-client-compiler based on the goal.

It does also seem rather odd that the ‘compiler’ jar includes the jetty ‘runtime’.

With Maven, use the scope “provided” for the client compiler dependency.

The GWT compiler includes Jetty as it is used by some of its development/debugging tools (devmode, which acts as a server).

Using Vaadin 7.7.6
Tomcat 8.5.9

Has this NPE been fixed?

If I do: @Push(transport = Transport.LONG_POLLING) // SEEMS TO WORK
But if I do…

@Push(transport = Transport.WEBSOCKET_XHR) //NPE -or- @Push(transport = Transport.WEBSOCKET) //NPE Looks like the same NPE mentioned by Risto above:

Feb 07, 2017 1:40:43 AM com.vaadin.server.DefaultErrorHandler doDefault SEVERE: java.lang.NullPointerException at org.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory.java:238) at org.eclipse.jetty.websocket.WebSocketFactory.acceptWebSocket(WebSocketFactory.java:396) at org.atmosphere.container.JettyWebSocketUtil.doService(JettyWebSocketUtil.java:60) at org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket.service(JettyServlet30AsyncSupportWithWebSocket.java:52) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2075) at com.vaadin.server.communication.PushRequestHandler.handleRequest(PushRequestHandler.java:248) at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1422) at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:379) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Thanks

I was getting this error while using tomcat with vaadin 7 and atmosphere. The error had no effect on the good behavior of the application but was popping up every now and then.

java.lang.NullPointerException
at org.eclipse.jetty.websocket.WebSocketFactory.upgrade(WebSocketFactory.java:238)

Solved the problem by removing the gwt-dev-2.7.0.vaadin4.jar from my classpath. It seems I didn’t need it anyway.

Solved the problem by removing the gwt-dev-2.7.0.vaadin4.jar from my classpath.

Yes, because that jar includes Jetty for serving the sourcecodes in superdevmode. You should not package that in war.