SimpleHttpConnectionManager 使用不当 [英] SimpleHttpConnectionManager being used incorrectly

查看:45
本文介绍了SimpleHttpConnectionManager 使用不当的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SimpleHttpConnectionManager 使用不当.确保始终调用 HttpMethod.releaseConnection() 并且一次只有一个线程和/或方法正在使用此连接管理器.

有谁知道为什么会出现此错误并导致我想下载或失败并重试或下载未完成的文件

谢谢!

解决方案

确保您不使用 SimpleHttpConnectionManager 创建和使用来自多个线程的连接.简单的连接管理器不是为它设计的 - 它总是返回相同的连接,这不是线程安全的.

在多线程环境中,使用使用连接池的不同管理器.请参阅 MultiThreadedHttpConnectionManager.>

SimpleHttpConnectionManager being used incorrectly. Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.

Does Anyone know why this error shows up and is causes the files I want to download or to fail and retry or to download uncompleted

Thank you !

解决方案

Make sure that you don't use SimpleHttpConnectionManager to create and use connections from multiple threads. The simple connection manager is not designed for it - it returns always the same connection, and this is not thread safe.

In a multi-threaded environment, use a different manager that uses a pool of connections. See MultiThreadedHttpConnectionManager.

这篇关于SimpleHttpConnectionManager 使用不当的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆