我是 Zone 面板 JFrame 的构造函数。我必须从服务器获取区域列表和运营商列表。我正在使用 HttpAsyncClient 库来转发我的请求。问题是在开始时我发送请求我的 1 个列表(即区域列表)它正在工作但是当我发送请求以获取 2 个列表时它给了我
Exception in thread "AWT-EventQueue-0"
java.lang.NoSuchMethodError:org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.
<init>(Lorg/apache/http/impl/nio/reactor/IOReactorConfig;)at
org.apache.http.impl.nio.client.AbstractHttpAsyncClient.<init>
(AbstractHttpAsyncClient.java:133)
at org.apache.http.impl.nio.client.DefaultHttpAsyncClient.<init>
(DefaultHttpAsyncClient.java:64)
同样,如果我只发送请求(运营商列表)它工作正常但是......当我发送两个请求时它不起作用..这是我的请求发件人类...... public JSONArray sendRequest(List postPairs){
try {
//At this line code gives me exception i do't know why..?
HttpAsyncClient httpclient = new DefaultHttpAsyncClient();
httpclient.start();
System.out.println(postPairs.get(0).getValue());
HttpPost post = new HttpPost("http://10.0.0.62:8080/IDocWS/"+postPairs.get(0).getValue());
//HttpPost post = new HttpPost("http://www.google.com");
Future<HttpResponse> future = httpclient.execute(post, null);
HttpResponse resp = future.get();
HttpEntity entity = resp.getEntity();
JSONArray jArray = CovnertToJson(entity);
return jArray;