java httpclient 请求时 Invalid use of SingleClientConnManager: connection still allocated. Make sure

错误原因:你的程序打开至少两个连接,而第一次连接后没有关闭post或者get

解决办法:注释的部分就是解决办法


			http1 = "http://localhost:8081/sawp/SakAction.do?doMethod=getSortedList1";
			
			httpPost = new HttpPost(http1);
			
			response = client.execute(httpPost);
			
			entity = response.getEntity();
			
//			if(entity!=null){
//				entity.consumeContent();
//			}

猜你喜欢

转载自blog.csdn.net/rjkkaikai/article/details/81481735
今日推荐