在tomcat 7.0.73中使用長輪詢獲取跟隨錯誤的cometd 3.0.1。我們還沒有看到這個問題與tomcat 7.0.50。在Tomcat 7.0.71上面對CometD的問題
從顯影劑的cometd
javax.servlet.ServletRequestWrapper.getAsyncContext(ServletRequestWrapper.java:418) org.cometd.server.transport.AbstractStreamHttpTransport.process(AbstractStreamHttpTransport.java:88)
這是恢復的cometd具有懸浮它經過漫長的調查,所以 它是完全合法的調用getAsyncContext(),這是Tomcat的 抱怨。
有沒有辦法讓長時間輪詢工作與Tomcat?
Time: Fri Mar 24 2017 17:46:55 GMT+0530 (India Standard Time) Channel: null Reason: Error occured during CometD connect.
Failure Message: {"id":"4","successful":false,"channel":"/meta/connect","failure":{"reason":"error","exception":"Internal Server Error","httpCode":500,"connectionType":"long-polling","transport":{"readyState":4,"withCredentials":true,"responseText":"
HTTP Status 500 - java.lang.RuntimeException: java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
type Exception report
message java.lang.RuntimeException: java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.RuntimeException: java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)\n\tcom.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38)\n\torg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)\n\torg.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)\n\torg.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)\n\torg.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:317)\n\torg.apache.coyote.http11.AbstractHttp11Processor.asyncDispatch(AbstractHttp11Processor.java:1681)\n\torg.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:616)\n\torg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1756)\n\torg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1715)\n\tjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\torg.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tjava.lang.Thread.run(Thread.java:745)\n
root cause
java.lang.RuntimeException: java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)\n\tcom.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38)\n\torg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)\n\torg.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)\n\torg.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)\n\torg.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:317)\n\torg.apache.coyote.http11.AbstractHttp11Processor.asyncDispatch(AbstractHttp11Processor.java:1681)\n\torg.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:616)\n\torg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1756)\n\torg.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1715)\n\tjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\torg.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tjava.lang.Thread.run(Thread.java:745)\n
root cause
java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)\n\torg.apache.catalina.connector.Request.getAsyncContext(Request.java:1740)\n\torg.apache.catalina.connector.RequestFacade.getAsyncContext(RequestFacade.java:1047)\n\tjavax.servlet.ServletRequestWrapper.getAsyncContext(ServletRequestWrapper.java:418)\n\torg.cometd.server.transport.AbstractStreamHttpTransport.process(AbstractStreamHttpTransport.java:88)\n\torg.cometd.server.transport.AbstractStreamHttpTransport.handle(AbstractStreamHttpTransport.java:61)\n\torg.cometd.server.CometDServlet.service(CometDServlet.java:103)\n\tjavax.servlet.http.HttpServlet.service(HttpServlet.java:731)\n
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.73 logs.
Apache Tomcat/7.0.73
","status":500,"statusText":"Internal Server Error"},"message":{"channel":"/meta/connect","connectionType":"long-polling","id":"4","clientId":"a10paginvut3d5yfwc3azxjvpa","ext":{"ack":-1}}}}