开发者社区> 问答> 正文

String result=Utils.sendHttpClie?报错

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.http.impl.client.CloseableHttpClient.<init>(CloseableHttpClient.java:58)
at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:287)
at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:147)
at com.java.test.httpClient.Utils.sendHttpClientPost(Utils.java:48)
at com.java.test.httpClient.Utils.main(Utils.java:101)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
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)
... 5 more


展开
收起
爱吃鱼的程序员 2020-06-12 10:55:21 433 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    解决了,要导四个jar包

    有main方法吗?另外eclipse的话,可以在debugconfiguration中的现有的运行记录删掉,再运行总感觉你这少了 commons- logging的jar包。
    2020-06-12 10:55:38
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
How to Build a Successful Data 立即下载
The Value of Exploratory Data 立即下载
低代码开发师(初级)实战教程 立即下载

相关实验场景

更多