无法创建新的PoolingHttpClientConnectionManager [英] Failing to create new PoolingHttpClientConnectionManager

查看:797
本文介绍了无法创建新的PoolingHttpClientConnectionManager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序包含以下行,并且此时挂起,我不太清楚为什么。

My program contains the following line, and just hangs at this point, and I'm not quite sure why.

PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();

在Eclipse中调试时,如果我尝试在Display视图中评估new PoolingHttpClientConnectionManager()得到这些错误:

When debugging in Eclipse, if I try to evaluate "new PoolingHttpClientConnectionManager()" in the Display view I get these errors:

java.lang.NoClassDefFoundError: org/apache/http/config/Lookup
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    ...omitted - referring to specific lines in code...
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.http.config.Lookup
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 10 more

我正在使用org.apache.httpcomponents中的httpclient.jar版本4.3.1。

I am using httpclient.jar version 4.3.1 from org.apache.httpcomponents.

其他人遇到此问题?有解决方案吗或者我在做些什么傻事?

Anyone else experience this problem? Any solution? Or am I doing something silly?

推荐答案

你还有 httpcore jar? (4.3版本)我在那里找到了那个课程。

Do you also have httpcore jar? (version 4.3 as well) I've found that class there.

这篇关于无法创建新的PoolingHttpClientConnectionManager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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