gpt4 book ai didi

cookies - java.lang.IllegalArgumentException :An invalid character [34] was present in the Cookie value 异常

转载 作者:行者123 更新时间:2023-12-05 08:41:53 24 4
gpt4 key购买 nike

这是我的 tomcat-users 文件的样子:

<tomcat-users>
<role rolename="admin"/>
<role rolename="analyst"/>
<role rolename="user"/>
<role rolename="kie-server"/>
<role rolename="developer"/>
<role rolename="manager"/>

<user username="w" password="w" roles="admin"/>
<user username="k" password="k" roles="kie-server"/>
<user username="u" password="u" roles="user,developer,analyst"/>
</tomcat-users>

在 KIE IDE WORKBENCH 中输入正确的凭据后,出现以下异常:

java.lang.IllegalArgumentException: An invalid character [34] was present in the Cookie value
org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateCookieValue(Rfc6265CookieProcessor.java:182)
org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6265CookieProcessor.java:115)
org.apache.catalina.connector.Response.generateCookieString(Response.java:1019)
org.apache.catalina.connector.Response.addCookie(Response.java:967)
org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:386)
org.uberfire.ext.security.server.SecurityIntegrationFilter.doFilter(SecurityIntegrationFilter.java:61)

最佳答案

CookieProcessor 是一个新的配置元素,在 Tomcat 8.0.15 中引入。CookieProcessor 元素允许在每个 Web 应用程序中或全局默认的 conf/context.xml 文件中进行不同的 cookie 解析配置。

根据官方文档 Apache Tomcat 8 Configuration ReferenceVersion 8.0.47 :

CookieProcessor 的标准实现是:org.apache.tomcat.util.http.LegacyCookieProcessor。请注意,预计这将在未来的 Tomcat 8 版本中更改为 org.apache.tomcat.util.http.Rfc6265CookieProcessor。

后来..

根据官方文档 Apache Tomcat 8 Configuration ReferenceVersion 8.5.23

CookieProcessor 的标准实现是 org.apache.tomcat.util.http.Rfc6265CookieProcessor

要解决此问题:在 conf/context.xml 中的 %CATALINA_HOME% 位置添加此行(即在我的例子中为 C:\apache-tomcat-8.5.20\conf\context.xml):

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

添加后是这样的:

<?xml version="1.0" encoding="UTF-8"?>

<Context reloadable="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory"/>
<CookieProcessor className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
</Context>

关于cookies - java.lang.IllegalArgumentException :An invalid character [34] was present in the Cookie value 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46686018/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com