Bug 56575 - [websocket][AsyncContext][Ubuntu] java.lang.IllegalStateException: Not supported. event when async-supported set to true
Summary: [websocket][AsyncContext][Ubuntu] java.lang.IllegalStateException: Not suppor...
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.8
Hardware: PC Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-29 12:46 UTC by Jean-Francois Arcand
Modified: 2014-06-02 12:40 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Francois Arcand 2014-05-29 12:46:11 UTC
I have a user that reported an issue with Tomcat8 + Ubuntu, where the same websocket application would work without any issue with Tomcat8 + Window:

   https://groups.google.com/forum/#!topic/atmosphere-framework/-exX6IKdB9s

Several users also reported similar issue with Tomcat 8, not only on Ubuntu, but it is extremely hard to reproduce. But the user above was able to reproduce it 100% of the time. The observed exception is

06:38:07.568 ERROR [http-nio-8080-exec-2] o.a.c.AtmosphereFramework [AtmosphereFramework.java:1822] AtmosphereFramework exception
java.lang.IllegalStateException: Not supported.
	at org.apache.catalina.connector.Request.startAsync(Request.java:1604) ~[catalina.jar:8.0.5]
	at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1037) ~[catalina.jar:8.0.5]
	at org.atmosphere.cpr.AtmosphereRequest.startAsync(AtmosphereRequest.java:692) ~[AtmosphereRequest.class:2.1.4]
	at org.atmosphere.container.Servlet30CometSupport.suspend(Servlet30CometSupport.java:93) ~[Servlet30CometSupport.class:2.1.4]
	at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:68) ~[Servlet30CometSupport.class:2.1.4]
	at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1801) ~[AtmosphereFramework.class:2.1.4]
	at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:210) [AtmosphereServlet.class:2.1.4]
	at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:196) [AtmosphereServlet.class:2.1.4]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:618) [servlet-api.jar:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [servlet-api.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301) [catalina.jar:8.0.5]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.5]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.0.5]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.5]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.5]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) [catalina.jar:8.0.5]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.5]

Note that <async-supported>true</async-supported> is defined in web.xml. The sample used to reproduce the issue is:

   http://goo.gl/AxmXf9

Now when using Tomcat 7 everything works as expected, both using native and jsr356 implementation for websocket. I'm not sure if that is caused by the websocket implementation, but I must say it always happens when there is a mix or websocket and http/comet connections occuring. 

The sample above is configured to use websocket when available, and fallback to long-polling if websocket aren't supported. That's the case when IE 9 fails.

Sorry if the issue is vague, but it is extremely hard to reproduce.
Comment 1 Jean-Francois Arcand 2014-06-02 12:40:40 UTC
Sorry for the trouble, the user found the issue:

======================

Hi Jeanfrancois,

I have investigated more on this, problem is only coming when i use memcached-session-manager in the tomcat. Otherwise chat application works perfectly fine in tomcat 8 & 7. 

This problem even exists in tomcat 7 also if we use memcached-session-manager.

Sorry for creating confusion.

Thanks a lot,
Kartik
========================