public String Stop() throws HttpResponseException, IOException{ try { return client.get(url + "stop"); } catch (IOException ex){ if(((HttpResponseException)ex).getStatusCode() == 405) { stopPost(); return ""; } } return ""; } java.lang.ClassCastException: org.apache.http.client.ClientProtocolException cannot be cast to org.apache.http.client.HttpResponseException