gpt4 book ai didi

java - 异步请求不适用于 Tomcat 7/Terracotta 3.6

转载 作者:行者123 更新时间:2023-12-01 14:22:21 24 4
gpt4 key购买 nike

我正在开发一个 Tomcat 7 Web 应用程序,其中包含使用 DeferredResponse 对象的异步调用。

一切都很好,直到我们将 Terracotta 引入集群中以进行 session 共享。我现在在 Catalina 日志中看到了这一点:

java.lang.IllegalStateException: Async support must be enabled on a servlet and
for all filters involved in async request processing. This is done in Java code
using the Servlet API or by adding "<async-supported>true</async-supported>" to
servlet and filter declarations in web.xml.

我们在整个配置过程中都使用了该标签,这已经完成了工作,直到 TerracottaTomcat70xSessionValve 阀门被引入到 Tomcat context.xml 配置中:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Valve className="org.terracotta.session.TerracottaTomcat70xSessionValve" tcConfigUrl="[config-url]" />
</Context>

我正在寻找的是如何配置 Terracotta Session Valve 以支持异步请求?

最佳答案

我遇到了类似的问题。尝试在标签 Valve 中添加参数 asyncSupported="true"。就我而言,它确实有效。

<Context>
<Valve className="org.terracotta.session.TerracottaTomcat70xSessionValve" asyncSupported="true" tcConfigUrl="[config-url]" />

关于java - 异步请求不适用于 Tomcat 7/Terracotta 3.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17438071/

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