一个 Connection 正在超时,并且它的开发人员在他的想法列表的底部。
日志有一个友好的:
[6/24/10 6:32:34:032 EDT] 0000000d ThreadMonitor W WSVR0605W: Thread "WebContainer : 136" (0000c53e) has been active for 719542 milliseconds and may be hung. There is/are 45 thread(s) in total in the server that may be hung.
代码如下:
try {
final URLConnection connection = url.openConnection();
connection.setConnectTimeout(CONNECT_TIME_SECONDS * 1000);
connection.setReadTimeout(READ_TIME_SECONDS * 1000);
is = connection.getInputStream();
document = builder.parse(is);
} catch (SAXException e) {
log.error(e);
throw new PageContentException(e);
} finally {
if (is != null) {
is.close();
}
}
我最好的猜测是 url.openConnection() 正在尝试在连接超时降低到合理的值之前打开连接,但是API中没有任何内容可以告诉我如何以不同的方式进行操作。
关于尝试什么的建议?