[Tomcat]报错,跪求 tomcat 大佬进来指点!

2019-09-24 11:30:32 +08:00
 sodadev

24-Sep-2019 11:25:32.062 SEVERE [http-nio-8080-exec-35] org.apache.coyote.http11.AbstractHttp11Processor.process Error processing request java.lang.IllegalArgumentException: Control character in cookie value or attribute. at org.apache.tomcat.util.http.LegacyCookieProcessor.isV0Separator(LegacyCookieProcessor.java:748) at org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader(LegacyCookieProcessor.java:545) at org.apache.tomcat.util.http.LegacyCookieProcessor.parseCookieHeader(LegacyCookieProcessor.java:273) at org.apache.catalina.connector.Request.parseCookies(Request.java:2949) at org.apache.catalina.connector.Request.getServerCookies(Request.java:2004) at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1205) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:916) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:513) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478) 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)


突然接到运维任务,这是某 zf 的办公平台的 tomcat 报错,我查了一天也没找到合适的答案,跪求大佬们指导一下处理思路!多谢了!

4053 次点击
所在节点    Java
4 条回复
bifwig
2019-09-24 11:36:26 +08:00
360 浏览器访问的?
Giny
2019-09-24 11:42:42 +08:00
说的的是 cookie 中的值 编码有问题 ,能不能 统一为 cookie 设置 utf-8 的编码 类似这样
设置 cookie
Cookie cookie = new Cookie(name, URLEncoder.encode(value, "UTF-8"));
读取 cookie
String value = URLDecoder.decode(cookie.getValue(), "UTF-8");
uleh
2019-09-24 11:51:05 +08:00
`Control character in cookie value or attribute.`

清一下浏览器 cookie 然后重新访问
sodadev
2019-10-28 16:42:54 +08:00
@bifwig 是 ie 浏览器 或者 360 浏览器

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/603645

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX