Re: AjaxServlet on Tomcat

I am giving a try on geronimo (2.2) which uses jetty as the servlet engine.
I am not sure whether it will be successful because as far as i know
Continuation is introduced in Servlet 3.0 and geronimo is on 2.5.

Re: AjaxServlet on Tomcat

I have same problem with AJAXMQServlet and Tomcat 7.0.22 HERE.
But same web application works with Tomcat 6.0.20 and 6.0.33.
When trying Tomcat 7.0.22, I though maybe I should use Jetty 8 which is support Servlet 3.0, like Tomcat 7, but still has same problem - "java.lang.IllegalStateException: Not supported".
So I downloaded Tomcat 6.0.33 and tried again with same web application and Jetty 8 jars, and amazing! It works!

SEVERE: Servlet.service() for servlet AjaxServlet threw exception
java.lang.IllegalStateException: !(Jetty || Servlet 3.0 || ContinuationFilter)
at org.eclipse.jetty.continuation.ContinuationSupport.getContinuation(ContinuationSupport.java:145)
at org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:301)
at org.apache.activemq.web.MessageListenerServlet.doGet(MessageListenerServlet.java:247)
at org.apache.activemq.web.AjaxServlet.doGet(AjaxServlet.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)

From what I can figure from this, it means that I either don't have Jetty, don't use servlet 3.0 or don't have the continuationfilter.

Since tomcat 6 doesn't support servlet 3.0 I tried the same setup in tomcat 7, but then I get the aforementioned 'not supported' exception

SEVERE: Servlet.service() for servlet [AjaxServlet] in context with path [/Tomcat7Test] threw exception
java.lang.IllegalStateException: Not supported.
at org.apache.catalina.connector.Request.startAsync(Request.java:1663)
at org.apache.catalina.connector.Request.startAsync(Request.java:1656)
at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1022)
at org.eclipse.jetty.continuation.Servlet3Continuation.suspend(Servlet3Continuation.java:184)
at org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:318)
at org.apache.activemq.web.MessageListenerServlet.doGet(MessageListenerServlet.java:247)
at org.apache.activemq.web.AjaxServlet.doGet(AjaxServlet.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Re: AjaxServlet on Tomcat

Hi I've been using AjaxServelt on tomcat for the last five years or so, I'm currently using Tomcat 7.0.26 and active mq 5.5.1.
Works well with the exception of one problem I'll be posting in a minute (problems shutting down).

In my myWebApp/WEB-INF/lib directory i have:
activemq-all-5.5.1.jar
activemq-web-5.5.1.jar
camel-core-2.7.0.jar
jetty-all-server-7.1.6.v20100715.jar
log4j-1.2.14.jar
slf4j-log4j12-1.5.11.jar
Sorry I don't have more of the details on why or how (its been a life time since I implemented it).