0

我正在尝试实现彗星进程。

雄猫 6.0.36

红帽企业 Linux 服务器 6.2 版(圣地亚哥)

Java 7u11(32 位)

我已经实现了 CometProcessor。我正在使用 NIO 连接器。当我尝试 servlet 时,我得到:此 URL 不支持 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 日志:

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

来自 catalina.out:

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
4

1 回答 1

0

我解决了。我使用的是调用者 servlet,因为我们有很多未映射的 servlet。删除调用者 servlet 修复了彗星进程。

于 2013-01-25T15:05:59.120 回答