Olha, tem como você mandar o trecho do seu código fonte que implementa a conexão HTTP, pois vc só mandou as printstacktrace.
Fico no aguardo e espero poder lhe ajudar
Abraços e bons códigos
W
wcandeiaPJ
Saudações!
O trecho é esse:
publicvoidrun(){OutputStreamsaida=null;InputStreamis=null;HttpConnectioncon=null;Stringparametro=tParametro.getString();try{Stringurl=tUrl.getString();url=url+"?"+"user="+parametro;if(!url.startsWith("http://")&&!url.startsWith("https://")){url="http://"+url;}con=(HttpConnection)Connector.open(url);con.setRequestMethod(HttpConnection.GET);}catch(Exceptionex){Alertalert=newAlert("Endereço Inválido","O endereço fornecido é inválido\n"+"Corrija-o e tente novamente.",null,AlertType.ERROR);alert.setTimeout(Alert.FOREVER);dTela.setCurrent(alert,fUrl);return;}try{if(con.getResponseCode()==HttpConnection.HTTP_OK){is=con.openInputStream();finalintMAX_LENGTH=1024;byte[]buf=newbyte[MAX_LENGTH];inttotal=0;while(total<MAX_LENGTH){intcont=is.read(buf,total,MAX_LENGTH-total);if(cont<0){break;}total+=cont;}is.close();Stringrespondendo=newString(buf,0,total);sResultado.setText(respondendo);}else{sResultado.setText("Falha do tipo "+con.getResponseCode()+"\n"+con.getResponseMessage());}for(inti=0;;i++){Stringkey=con.getHeaderFieldKey(i);Stringvalor=con.getHeaderField(i);if(key==null){break;}}con.close();dTela.setCurrent(fResultado);}catch(IOExceptionex){ex.printStackTrace();Alertalert=newAlert("Erro de E/S","Um erro ocorreu durante a comunicação com o servidor.",null,AlertType.ERROR);alert.setTimeout(Alert.FOREVER);dTela.setCurrent(alert,fUrl);return;}finally{try{if(is!=null){is.close();is=null;}}catch(IOExceptionex1){}try{if(con!=null){con.close();con=null;}}catch(IOExceptionex1){}}}