Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server: [http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException

My tomcat server always throws the following errors (Linux, Tomcat version is 8.5.4, using tail -f catalina.out):

The first error:

17-Jan-2017 10:39:24.982 SEVERE [http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.service Error processing request
 java.lang.NullPointerException
    at org.apache.catalina.connector.Request.parseCookies(Request.java:3047)
    at org.apache.catalina.connector.Request.getServerCookies(Request.java:2098)
    at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1007)
    at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:707)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

17-Jan-2017 10:39:24.983 SEVERE [http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.endRequest Error finishing response
 java.lang.NullPointerException

The second error:

17-Jan-2017 11:08:33.696 SEVERE [http-nio-8080-exec-8] org.apache.coyote.http11.Http11Processor.endRequest Error finishing response
 java.lang.NullPointerException

17-Jan-2017 11:08:33.743 SEVERE [http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.service Error processing request
 java.lang.NullPointerException

17-Jan-2017 11:08:33.743 SEVERE [http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.endRequest Error finishing response
 java.lang.NullPointerException

17-Jan-2017 11:08:33.838 SEVERE [http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.service Error processing request
 java.lang.NullPointerException

17-Jan-2017 11:08:33.838 SEVERE [http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.endRequest Error finishing response
 java.lang.NullPointerException

The third error:

17-Jan-2017 11:20:52.232 SEVERE [http-nio-8080-exec-3] org.apache.coyote.http11.Http11Processor.service Error processing request
 java.lang.NullPointerException
    at org.apache.tomcat.util.buf.MessageBytes.toChars(MessageBytes.java:257)
    at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:641)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

The front end html always print the errors:

Failed to load resource: the server responded with a status of 502 (Bad Gateway)

Backend server mainly use Spring, Jersey and the front end uses H5, AngularJS. Any idea, i will appreciate!

like image 951
Java Basketball Avatar asked Sep 11 '26 21:09

Java Basketball


1 Answers

This is a bug of tomcat that was introduced by the refactoring in 8.5.x onwards. You can search the tomcat bug list https://bz.apache.org/bugzilla/show_bug.cgi?id=60918

You can solve the problem by upgrade the tomcat version, or modify the server.xml set useSendfile="false"

<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" maxHttpHeaderSize="16384" maxThreads="2000" connectionTimeout="60000" disableUploadTimeout="true" redirectPort="8443" useSendfile="false"/>
like image 89
zhHebut Avatar answered Sep 13 '26 13:09

zhHebut