错误代码
java.lang.IllegalStateException: A filter or servlet of the current chain does not support asynchronous operations.
at org.apache.catalina.connector.Request.startAsync(Request.java:1675)
at org.apache.catalina.connector.Request.startAsync(Request.java:1668)
at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1022)
at org.eclipse.jetty.continuation.Servlet3Continuation.suspend(Servlet3Continuation.java:202)
at org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:349)
at org.apache.activemq.web.MessageListenerServlet.doGet(MessageListenerServlet.java:250)
at org.apache.activemq.web.AjaxServlet.doGet(AjaxServlet.java:47)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.eclipse.jetty.continuation.ContinuationFilter.doFilter(ContinuationFilter.java:137)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
** 我的web.xml配置**
<?xml version="1.0" encoding="UTF-8"?>
mqajax
Whether we should include an embedded broker or not
org.apache.activemq.brokerURL
tcp://127.0.0.1:61616 <!-- 这里可以写tcp://192.168.1.111:61616的形式连接其他服务器上的ActiveMQ服务器 -->
AjaxServlet
org.apache.activemq.web.AjaxServlet
1
true
MessageServlet
org.apache.activemq.web.MessageServlet
1
QueueBrowseServlet
org.apache.activemq.web.QueueBrowseServlet
PortfolioPublishServlet
org.apache.activemq.web.PortfolioPublishServlet
1
AjaxServlet
/amq/*
MessageServlet
/message/*
QueueBrowseServlet
/queueBrowse/*
PortfolioPublishServlet
/portfolioPublish
<!-- 这种方式是在tomcat7版本以下运行,因为ajax+activemq需要servlet3.0的支持,而servlet3.0又只有在tomcat7中得到支持,所有加上jetty此包,就能在tomcat6运行了 -->
session
org.eclipse.jetty.continuation.ContinuationFilter
session
/*
index.jsp
JS代码