我正在尝试在静态 Java 类上调用一个方法,该方法可能需要 10 秒到 1 分钟才能运行。大约 30 秒后,我得到了异常
java.net.SocketTimeoutException: Read timed out; Is the timeout preference too low? Are you dumping/calling debug() on large data or cfc instances?
我已经能够使用以下最小示例来复制它。在 Java 中:
package some.package;
public class Sleeper {
public static void sleep(int seconds) {
Thread.sleep(seconds * 1000);
}
}
然后我有一个 MxUnit 测试:
<cffunction name="timeoutTest" access="public" returnType="void" output="false>
<cfset sleeper = CreateObject("java", "some.package.Sleeper" />
<cfset runner.sleep(32) />
</cffunction>
在服务器设置上设置 my Timeout Requests after ( seconds)
to99999
没有帮助,也没有将测试更改为:
<cffunction name="timeoutTest" access="public" returnType="void" output="false>
<cfset sleeper = CreateObject("java", "some.package.Sleeper" />
<cfsetting requesttimeout="64" />
<cfset runner.sleep(32) />
</cffunction>
我想在某个地方有一个设置,但如果是这样我找不到它。我正在运行 ColdFusion 8