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>