tomcat 设置报错:Http11Processor.service Error processing request java.lang.NullPointerException

0-Jul-2018 16:21:55.904 严重 [http-nio-80-exec-5] org.apache.coyote.http11.Http11Processor.service Error processing request
 java.lang.NullPointerException
	at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256)
	at org.apache.catalina.mapper.Mapper.map(Mapper.java:695)
	at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)

1、解决方法:tomcat版本问题,我是用的8.0换成9.0这个问题也没决绝。
2、解决方法:在Connector添加URIEncoding=‘UTF-8’,也没有解决问题。
3、解决方法:看着一句,默认HOST是localhost,如果没有这个host就会报空指针异常,增加解决。如果当时是复制的HOST新增而不是修改就不会报错了。
上述3个方法不能说哪一个错,可能这三个问题都可能引起这个错误,只是刚好我的用方法三解决。


补充:用第三个方法在每次启动Tomcat时还会报一个错误,意思是这个主机不是有效的

01-Aug-2018 00:59:28.028 信息 [https-jsse-nio-443-exec-8] org.apache.coyote.AbstractProcessor.parseHost The host [] is not valid
 Note: further occurrences of request parsing errors will be logged at DEBUG level.
 java.lang.IllegalArgumentException
	at org.apache.tomcat.util.http.parser.Host.parse(Host.java:78)
	at org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)
	at org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:273)
	at org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:809)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)

,添加完整的配置即可


      
    

你可能感兴趣的:(Tomcat)