问题:服务器抛出302临时重定向为Http11AprProtocol协议

时间:2019-10-25 06:32:06

标签: tomcat http2 tomcat9 apr

最近,我们开始为服务器支持HTTP2。我们使用以下配置升级HTTP2协议。构建开始,没有错误。但是,在运行服务器后,我们面临着一个关键问题,即某些请求已从服务器移到302状态代码。而且我在catalina.out文件中没有发现任何异常。

配置

<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
     SSLEnabled="true" acceptCount="1000" maxSpareThreads="75" maxThreads="500" 
     minSpareThreads="25" compression="on" >
      <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" 
       compression="on" />
      <SSLHostConfig honorCipherOrder="false">
        <Certificate certificateKeyFile="conf/server.key" certificateFile="conf/server.crt"/>
      </SSLHostConfig>
    </Connector>

在localhost_日志文件中有一些线索。在.invoke方法中发现了NullPointerException。仅将这些请求移至302状态代码。

==> localhost.2019-10-24.log <==
24-Oct-2019 03:32:16.106 SEVERE [https-openssl-apr-8443-exec-16] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [default] in context with path [] threw exception
java.lang.NullPointerException
24-Oct-2019 03:32:16.843 SEVERE [https-openssl-apr-8443-exec-14] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [default] in context with path [] threw exception
java.lang.NullPointerException
==> localhost_access_log.2019-10-24.txt <==
121.244.91.22 - - [24/Oct/2019:03:32:12 -0700] POST /app/get_notification_count HTTP/2.0 200 73
121.244.91.21 - - [24/Oct/2019:03:32:14 -0700] POST /app/get_all_tag_details HTTP/2.0 200 4401
121.244.91.20 - - [24/Oct/2019:03:32:15 -0700] POST /app/get_notification_count HTTP/2.0 200 72
121.244.91.21 - - [24/Oct/2019:03:32:16 -0700] POST /app/get_notification_count HTTP/2.0 302 -
117.239.106.136 - - [24/Oct/2019:03:32:16 -0700] POST /app/get_notification_count HTTP/2.0 200 73
121.244.91.21 - - [24/Oct/2019:03:32:16 -0700] POST /app/get_notification_count HTTP/2.0 302 -
121.244.91.21 - - [24/Oct/2019:03:32:17 -0700] POST /app/get_all_user_details HTTP/2.0 200 1149
121.244.91.21 - - [24/Oct/2019:03:32:17 -0700] GET /app HTTP/2.0 200 2512

当我切换到其他网络时,它可以正常工作(状态代码200),而不会出现错误。我对这种情况非常困惑。重新启动tomcat服务器后无法重现该问题。

Tomcat版本:> 9

如果能帮助我,我将不胜感激。

0 个答案:

没有答案