spring-boot 錯誤日誌一
阿新 • • 發佈:2018-12-22
最近一個專案中用到了springboot 在專案啟動後報錯:
===2018-11-19 08:47:10.796 INFO org.apache.coyote.http11.Http11Processor Line:182 - Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:426) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:687) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) 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:748)
在網上找了下 解決辦法:
一:原因是Tomcat的header緩衝區大小不夠,只需要在server.xml中增加maxHttpHeaderSize欄位即可:
二:本是http的請求 錯誤使用https方式請求 就會報該錯
試了下第二種對的 我認為跟設定server.xml沒多大關係
springboot集成了多種容器 其中Tomcat是一種 之所以main方法啟動因為可以再其整合的Tomcat中釋出 而不是在自己配置的Tomcat中釋出
下篇文章說下 http與https