2 green lily green_lily 于 2017.09.11 17:53 提问

Exception in thread "main"

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.impl.conn.CPool.setValidateAfterInactivity(I)V
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:182)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:164)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:155)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:131)
at com.baidubce.http.BceHttpClient.createHttpClientConnectionManager(BceHttpClient.java:354)
at com.baidubce.http.BceHttpClient.(BceHttpClient.java:135)
at com.baidubce.http.BceHttpClient.(BceHttpClient.java:174)
at com.baidubce.AbstractBceClient.(AbstractBceClient.java:106)
at com.baidubce.AbstractBceClient.(AbstractBceClient.java:121)
at com.baidubce.services.sms.SmsClientSupport.(SmsClientSupport.java:47)
at com.baidubce.services.sms.SmsClient.(SmsClient.java:61)
at com.lushui.api.utils.MySmsClient.sendMessage(MySmsClient.java:36)
at com.lushui.api.utils.MySmsClient.main(MySmsClient.java:87)

8个回答

morgerton
morgerton   2017.09.11 18:26
weixin_39158271
weixin_39158271   2017.09.11 19:21

应该是连接池创建连接时出现的问题,检查能否获取到连接对象,以及账号密码等;

longlong3207
longlong3207   2017.09.11 21:01

线程中的异常,没有这个方法,你也不把代码粘出来,没办法具体说啊

weixin_40201146
weixin_40201146   2017.09.12 00:55

要把代码贴出来 才能找到根源阿 哥

u010278862
u010278862   2017.09.12 07:36

我的天 还有这样提问的,啥话都不说只给个堆栈信息。

qasrc6
qasrc6   2017.09.12 08:29

org.apache.http.impl.conn.CPool.setValidateAfterInactivity(I)V 这个方法所在的jar包没有引入 ,到http://mvnrepository.com/中去把jar包下载引入 ,应该就没有问题了。

usecf
usecf   2017.09.12 08:39

看有对应的jar包没 有的话看引入的路径对不对

huang931027
huang931027   2017.09.12 08:53

.NoSuchMethodError 看到没,少了jar包啊

Csdn user default icon
上传中...
上传图片
插入图片