• 解决Tomcat的IllegalArgumentException: Control character in cookie value or attribute错误


    接口中带有中文,tomcat8

    17-Apr-2019 13:21:23.734 严重 [http-nio-8082-exec-2] 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:729)
    	at org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader(LegacyCookieProcessor.java:526)
    	at org.apache.tomcat.util.http.LegacyCookieProcessor.parseCookieHeader(LegacyCookieProcessor.java:256)
    	at org.apache.catalina.connector.Request.parseCookies(Request.java:3059)
    	at org.apache.catalina.connector.Request.getServerCookies(Request.java:2075)
    	at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1211)
    	at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:918)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:497)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533)
    	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    	at java.lang.Thread.run(Thread.java:745)
    

      

    解决方法:

     在tomcat下的conf/context.xml 

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

      

  • 相关阅读:
    数字音乐均衡器
    移植x264到vs2008之二
    无线连接频繁掉线,解决方法之telnet命令突破ddwrt端口最大数连接限制分析
    最新开发的消费平台开发过程 持续更新(二)
    .net 4.0 下请求验证模式变化 应对方法
    DDWRT无线参数解读
    利用 Application_Error 捕获所有异常
    location.reload() 和 location.replace()的区别和应用
    纯CSS 实现组织架构图,学习
    Syslog架设windows日志服务器
  • 原文地址:https://www.cnblogs.com/linlf03/p/10723008.html
Copyright © 2020-2023  润新知