2013-01-23 64 views
0

我正在嘗試實施Comet進程。未調用Tomcat Comet事件 - HTTP方法GET不受此URL支持

的Tomcat 6.0.36

紅帽企業Linux服務器版本6.2(聖地亞哥)

的Java 7u11(32位)

我已經實現CometProcessor。我正在使用NIO連接器。 當我嘗試使用servlet時:此方法不支持HTTP方法GET。 我在這個問題上發現的其他主題建議人們確保他們使用NIO連接器。我有。我還看到了一些建議,以確保catalina.jar不與Web應用程序一起打包。我也檢查過。

我做錯了什麼?

謝謝!

代碼片段:

public class ConsolidatedActionCenterPush extends HttpServlet implements CometProcessor,CAC{ 

    private static MessageSender messageSender = null; 
    private static final Integer TIMEOUT = 600 * 1000; 

    @Override 
    public void destroy() { 
    messageSender.stop(); 
    messageSender = null; 
    } 

    @Override 
    public void init() throws ServletException { 
    messageSender = new MessageSender(); 
    messageSender.start(); 

    } 


    @Override 
    public void event(final CometEvent event) throws IOException, ServletException { 
    HttpServletRequest request = event.getHttpServletRequest(); 
    HttpServletResponse response = event.getHttpServletResponse(); 

........ 

} 

從卡塔利娜日誌:從catalina.out的

Jan 22, 2013 11:46:19 AM org.apache.catalina.core.AprLifecycleListener init 
INFO: The APR based Apache Tomcat Native library which allows optimal performance in  production environments was not found on the java.library.path:  /usr/jre732/lib/i386/server:/usr/jre732/lib/i386:/usr/lib:/usr/java/packages/lib/i386:/lib:/usr/lib 
Jan 22, 2013 11:46:20 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 
INFO: Using a shared selector for servlet write/read 
Jan 22, 2013 11:46:20 AM org.apache.coyote.http11.Http11NioProtocol init 
INFO: Initializing Coyote HTTP/1.1 on http-8080 
Jan 22, 2013 11:46:20 AM org.apache.catalina.startup.Catalina load 
INFO: Initialization processed in 540 ms 
Jan 22, 2013 11:46:20 AM org.apache.catalina.core.StandardService start 
INFO: Starting service Catalina 
Jan 22, 2013 11:46:20 AM org.apache.catalina.core.StandardEngine start 
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36 
Jan 22, 2013 11:46:20 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory servlet 
Jan 22, 2013 11:46:23 AM org.apache.coyote.http11.Http11NioProtocol start 
INFO: Starting Coyote HTTP/1.1 on http-8080 
Jan 22, 2013 11:46:23 AM org.apache.jk.common.ChannelSocket init 
INFO: JK: ajp13 listening on /0.0.0.0:10794 
Jan 22, 2013 11:46:23 AM org.apache.jk.server.JkMain start 
INFO: Jk running ID=0 time=0/18 config=null 
Jan 22, 2013 11:46:23 AM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 3127 ms 

Jan 22, 2013 11:46:23 AM org.apache.coyote.http11.Http11NioProtocol start 
INFO: Starting Coyote HTTP/1.1 on http-8080 
Jan 22, 2013 11:46:23 AM org.apache.jk.common.ChannelSocket init 
INFO: JK: ajp13 listening on /0.0.0.0:10794 
Jan 22, 2013 11:46:23 AM org.apache.jk.server.JkMain start 
INFO: Jk running ID=0 time=0/18 config=null 
Jan 22, 2013 11:46:23 AM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 3127 ms 

回答

0

我解決它。我使用的是調用者servlet,因爲我們有很多未映射的servlet。刪除調用者servlet修復了彗星進程。

相關問題