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

1Pc Njk-5002C Normally Open Sensor Hall Effect Proximity Switch Npn 3-Wires Ic R
$2.71
1Pc Njk-5002C Normally Open Sensor Hall Effect Proximity Switch Npn 3-Wires Ic R picture1pc Tact Switch 12x12x8mm Press Key 12*12*8
$0.01
1pc Tact Switch 12x12x8mm Press Key 12*12*8 pictureRed Push Button Switch 3A 250V Off-(On) 1 Circuit Momentary SPST Car Dash Mount
$0.01
Red Push Button Switch 3A 250V Off-(On) 1 Circuit Momentary SPST Car Dash Mount picture1PCS Omron photoelectric switch E3S-R2E4 Test
$96.3
1PCS Omron photoelectric switch E3S-R2E4 Test  picture1PC NEW D4GS-NK2 Omron safety switch key
$25.07
1PC NEW  D4GS-NK2  Omron safety switch key picture






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