Tomcat 400错误:Invalid character found in the request target. 问题解决方法
来源:互联网 发布:linux系统巡检报告 编辑:程序博客网 时间:2024/06/08 15:11
Tomcat 7.069以后的版本会有这个问题。
最近部署项目的时候,由于MIS配置的是Tomcat 7.0.78的服务端,导致Web应用不正常,报HTTP 400错误(Chrome无异常、IE报错)。问题原因初步判断为7.078版本的服务端接收请求不会对符号进行转义,Chrome不异常的原因或许是浏览器自身转义了。具体错误信息如下:
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:472) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:683) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) 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)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
查阅了大量资料后,有两种解决方案:
Plan 1:
更换低版本的Tomcat来规避这种问题。
Plan 2:
在conf/catalina.properties中最后添加一行:
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
重启服务器后,解决问题。
官方指南地址:http://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html
官方说明:
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH
If this is true ‘%2F’ and ‘%5C’ will be permitted as path.delimiters.If not specified, the default value of false will be used.
- Tomcat 8.5 400错误:Invalid character found in the request target. 问题解决方法
- Tomcat 400错误:Invalid character found in the request target. 问题解决方法
- Invalid character found in the request target 问题解决
- 【Tomcat】Invalid character found in the request target
- 日常报错 Invalid character found in the request target.
- java.lang.IllegalArgumentException: Invalid character found in the request target.
- Invalid character found in the request target. 的解决办法
- 解决Tomcat报Invalid character found in the request target. The valid characters are defined in RFC 3986
- 异常:Invalid character found in the request target. The valid characters are defined in RFC 3986
- 异常:Invalid character found in the request target. The valid characters are defined in RFC 3986
- 异常:Invalid character found in the request target. The valid characters are defined in RFC 3986
- java.lang.IllegalArgumentException: Invalid character found in the request target. The valid charact
- java.lang.IllegalArgumentException: Invalid character found in the request target. The valid charact
- 解决在Tomcat7.0以上版本,Invalid character found in the request target问题
- url传参时报java.lang.IllegalArgumentException: Invalid character found in the request target.
- Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC
- Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC
- invalid character found in the request target the valid characters are defined in rfc 7230 and rfc 3
- Java数据结构与算法解析(十三)——优先级队列
- 拦截器
- 第一个页面
- WIN10 LOCALHOST 解析为 IPV6地址 ::1 的解决办法
- vue
- Tomcat 400错误:Invalid character found in the request target. 问题解决方法
- OkHttp封装
- 【Python基础教程笔记(三)】抽象,更加抽象和异常
- Awake()与Start()
- Servlet
- POSTMAN接口测试工具介绍
- java day08_day09基础梳理
- MongoDB (五):安全浅析
- MBR主引导扇区上,0扇区,512个字节,(主引导区一般在C盘,记录整个硬盘的情况;多系统其他盘也有引导区)