java - Tomcat 8.5.45 启动后抛出大量 NullPointerException-s 但继续工作

标签 java tomcat

最近我们将 Apache Tomcat 服务器从 8.5.32 更新到了 8.5.45。我们注意到,Tomcat 在启动后向 catalina.out 发送了 NullPointerException-s 的垃圾信号,但是,连接器一直运行良好,它处于打开状态并正在监听:

10-Oct-2019 10:48:31.210 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 13452 ms
10-Oct-2019 10:48:31.247 SEVERE [https-jsse-nio-8443-exec-2] org.apache.coyote.AbstractProtocol$ConnectionHandler.process Error reading request, ignored
        java.lang.NullPointerException
                at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.getSslSupport(NioEndpoint.java:1415)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
                at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1504)
                at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.lang.Thread.run(Thread.java:748)
10-Oct-2019 10:48:31.247 SEVERE [https-jsse-nio-8443-exec-3] org.apache.coyote.AbstractProtocol$ConnectionHandler.process Error reading request, ignored
        java.lang.NullPointerException
                at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.getSslSupport(NioEndpoint.java:1415)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
                at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1504)
                at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.lang.Thread.run(Thread.java:748)
10-Oct-2019 10:48:31.247 SEVERE [https-jsse-nio-8443-exec-3] org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun
        java.lang.NullPointerException
                at org.apache.coyote.http11.Http11InputBuffer.recycle(Http11InputBuffer.java:282)
                at org.apache.coyote.http11.Http11Processor.recycle(Http11Processor.java:1714)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.release(AbstractProtocol.java:993)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:961)
                at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1504)
                at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.lang.Thread.run(Thread.java:748)
10-Oct-2019 10:48:31.247 SEVERE [https-jsse-nio-8443-exec-4] org.apache.coyote.AbstractProtocol$ConnectionHandler.process Error reading request, ignored
        java.lang.NullPointerException
                at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.getSslSupport(NioEndpoint.java:1415)
                at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
                at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1504)
                at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                at java.lang.Thread.run(Thread.java:748)


我们确实检查了论坛等...找到了更改 protocol 的建议至org.apache.coyote.http11.Http11NioProtocol ,但这无济于事。
连接器配置如下:
<Connector port="8443" minProcessors="5" maxProcessors="75"
      protocol="org.apache.coyote.http11.Http11NioProtocol"
      SSLEnabled="true" server=" "
      enableLookups="false" disableUploadTimeout="true"
      acceptCount="100" debug="0" scheme="https" secure="true"
      keystoreFile="<keystore>"
      keystorePass="<password>"
      truststoreFile="<truststore>"
      truststorePass="<password>"
      URIEncoding="UTF-8"
      clientAuth="true" xpoweredBy="false" 
      connectionTimeout="60000" maxHttpHeaderSize="8192" 
      allowTrace="false"
      sslEnabledProtocols="TLSv1.2"
      SSLHonorCipherOrder="on"
      useServerCipherSuitesOrder="true"
      ciphers="SSL_DHE_DSS_WITH_AES_128_CBC_SHA..."/>

Tomcat和Java版本信息:
Server version: Apache Tomcat/8.5.45
Server built:   Aug 14 2019 22:21:25 UTC
Server number:  8.5.45.0
OS Name:        Linux
OS Version:     3.10.0-1062.1.1.el7.x86_64
Architecture:   amd64
JVM Version:    1.8.0_221-b11
JVM Vendor:     Oracle Corporation

最佳答案

我在使用 时遇到了类似的问题 Tomcat 8.5 Ubuntu 20.04 对于 Mifos X设置。
这是我的连接器 :

Connector protocol="org.apache.coyote.http11.Http11Protocol"
          port="8443" maxThreads="200" scheme="https"
          secure="true" SSLEnabled="true"
          keystoreFile="/usr/share/tomcat.keystore"
          keystorePass="GODMYROCK"
          clientAuth="false" sslProtocol="TLS"
          URIEncoding="UTF-8"
          compression="force"
          compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"/>
但是每次我启动应用程序时,它都会在日志中抛出以下错误:

SEVERE [https-jsse-nio-8443-exec-3] org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun java.lang.NullPointerException


这是我修复它的方法 :
我只是更改了连接器协议(protocol) 来自 org.apache.coyote.http11.Http11Protocolorg.apache.coyote.http11.Http11NioProtocol .所以我的连接器此后看起来像这样:
Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
          port="8443" maxThreads="200" scheme="https"
          secure="true" SSLEnabled="true"
          keystoreFile="/usr/share/tomcat.keystore"
          keystorePass="GODMYROCK"
          clientAuth="false" sslProtocol="TLS"
          URIEncoding="UTF-8"
          compression="force"
          compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"/>
就这样。
我希望这会有所帮助

关于java - Tomcat 8.5.45 启动后抛出大量 NullPointerException-s 但继续工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58320600/

相关文章:

Java 对象序列化性能技巧

java - NoSQL是否适合社交网络类应用程序

tomcat - Mobicents- Tomcat 上的 Sip Servlets - 断开多方连接

java - RESTful API 不使用 jersey framework 和 apache tomcat 服务器打印特定路径上的内容

java - 网络服务器的实现

java - ImagesService.getServingUrl 中的 URL 持续多长时间

java - 如何回滚 Play 框架中捕获的异常?

java - Tomcat启动时出现白标错误

java - Tomcat 安全角色映射

java - Log4j 配置 : how to use environment variable in yaml configuration file log4j2. yaml