关于 Tomcat运行时报 BAD packet signature 18245 异常

黄平俊 发布于 2009/10/24 11:22
阅读 2K+
收藏 0

报错的tomcat中的server.xml配制如下:

<Server port="8015" shutdown="SHUTDOWN">
  <Service name="Catalina">
    <Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol"
               connectionTimeout="20000"
               redirectPort="8443" />
    <Connector port="8099" protocol="AJP/1.3" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
            <Context  docBase="E:\eclipse3.4workspace\51named\webapp" path="" />
      </Host>
    </Engine>
  </Service>
</Server>

启动Tomcat时不会报错,一旦请求:http://localhost:8099就会报以下异常:

2009-10-24 10:47:21 org.apache.jk.common.MsgAjp processHeader
严重: BAD packet signature 18245
2009-10-24 10:47:21 org.apache.jk.common.ChannelSocket processConnection
严重: Error, processing connection
java.lang.IndexOutOfBoundsException
    at java.io.BufferedInputStream.read(BufferedInputStream.java:310)
    at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
    at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:577)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Thread.java:619)

访问http://localhost:80则不会报任何异常

原因:不是AJP协议的请求,请求了这个端口

为什么要有AJP配制和Http11NioProtocol配制呢?可以参考以下文章

1、Apache HTTP Server 与 Tomcat 的三种连接方式介绍

2、Tomcat的四种基于HTTP协议的Connector性能比较

加载中
0
JavaGG
JavaGG

现在ajp可以配nio了??

我记得以前如果用nio是用不了ajp的

返回顶部
顶部