Web Services 服务器:[http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.service处理请求java.lang时出错,

83qze16e  于 2023-06-23  发布在  Apache
关注(0)|答案(4)|浏览(646)

我的Tomcat服务器总是抛出以下错误(在Linux中,Tomcat版本是8.5.4,使用tail-fcatalina.out):
第一个错误:

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

第二个错误:

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

第三个错误:

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)

前端html总是打印错误:

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

后端服务器主要使用Spring、Jersey,前端使用H5、AngularJS。任何想法,我会欣赏!

ki1q1bka

ki1q1bka1#

这是tomcat在8.5.x以后的重构中引入的一个bug。您可以搜索Tomcat错误列表https://bz.apache.org/bugzilla/show_bug.cgi?id=60918
您可以通过升级tomcat版本或修改server.xml设置useSendfile=“false”来解决该问题。

<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" maxHttpHeaderSize="16384" maxThreads="2000" connectionTimeout="60000" disableUploadTimeout="true" redirectPort="8443" useSendfile="false"/>
wgmfuz8q

wgmfuz8q2#

我不是这方面的Maven,但它似乎是请求或cookie编码的某种问题。也可能是雄猫臭虫。
对于第一个错误,您可以尝试Rfc6265CookieProcessor.请检查this以了解详细信息。

<Context>
....
    <CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor" />
....
</Context>
ct2axkht

ct2axkht3#

这种类型的错误发生在Tomcat版本的某些问题时。如果没有一个测试用例来重现问题,Tomcat开发人员几乎无能为力。看起来像是多个线程同时作用于同一个套接字。我不知道这是故意的,是Tomcat bug的结果还是框架/应用程序正在做的事情。
我没有太多的知识,但我已经解决了我的问题after ready this.
其他解决方案:-
这也是asked before here。有可能你用的是哪个版本的tomcat?
对于这个例外

SEVERE: An exception or error occurred in the container during the request processing
java.lang.NullPointerException

你需要read this stack overflow answer.
502 Bad Gateway错误是一个HTTP状态代码,表示Internet上的一台服务器收到了来自另一台服务器的无效响应。为此,您需要read this tutorial.

xqnpmsa8

xqnpmsa84#

http-nio-8080替换为http://localhost:8080ip:8080

相关问题