BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 08-17-2007, 10:35 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8100
PIN: N/A
Carrier: movistar
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Error Httpconnection

Please Login to Remove!

Hello I have a called class syncrom in syncrom.java that the use to connect with httpconnection to a data base this class to me gives back string to me that it load with inputstream.

public class Syncrom extends Thread {

public String tipoConeccion = “visitasConn”;
public sServidor String = “200.200.200.200”; //IP SERVER

public String sConexion (String sQuery) {
httpConnector HttpConnection = null;
InputStream in = null;
StringBuffer to inBuffer = new StringBuffer ();
String response;
String cadenaResponse = "";
byte [] bufferLectura;

int to inChar;
retData String = "";
String URL = “http:// " +sServidor+”/“+tipoConeccion+” .asp? Q= " + sQuery;

try {
Common common = new Common ();
httpConnector = (HttpConnection) Connector.open (comun.replace (URL, ““, “%20”));
httpConnector.setRequestMethod (HttpConnection.GET);
httpConnector.setRequestProperty (“Content-Type”, “text/plain”);
in = httpConnector.openInputStream ();
long longitudDatos = httpConnector.getLength ();

bufferLectura = new byte [(int) longitudDatos];
in.read (bufferLectura);
cadenaResponse = new String (bufferLectura);

} catch (IOException ioe) {
System.out.println (“>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ERROR: “+ioe);
}
return cadenaResponse.substring (4, cadenaResponse.length ());
}


}

this class I call it of other classes.
when executing my application sends the following error to me:

“Uncaught exeption: blocking operation not permitted on event dispatch thread”

since I can cause that it works
Offline  
Old 08-22-2007, 01:10 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8100
PIN: N/A
Carrier: movistar
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default hello

sombody can help me??????
Offline  
Old 08-24-2007, 12:08 AM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You probably call your sConexion() method from UI event thread. This is incorrect and you can't call long operations there - it will freeze UI.
You should call network operations in separate thread.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

OEM BULB with Housing for DELL 331-1310 Projector with 180 Day Warranty
$149.0
OEM BULB with Housing for DELL 331-1310 Projector with 180 Day Warranty pictureOEM BULB with Housing for DELL 7700 FullHD Projector with 180 Day Warranty
$319.0
OEM BULB with Housing for DELL 7700 FullHD Projector with 180 Day Warranty pictureOriginal Chunghwa 15" CLAA150XP01QL A+ LCD Screen Display OEM Dell E157FPTe
$45.0
Original Chunghwa 15Dell FA65NS0-00 AC Power Supply Charger Adapter with strap Genuine OEM
$11.27
Dell FA65NS0-00 AC Power Supply Charger Adapter with strap Genuine OEM pictureArclyte Projector Lamp for Dell 310-6896 OEM Bulb with Housing
$184.84
Arclyte Projector Lamp for Dell 310-6896 OEM Bulb with Housing picture






Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.