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

EATON EASY-M-256K Memory Cartridge, For Easy700/800 Series
$38.7
EATON EASY-M-256K Memory Cartridge, For Easy700/800 Series pictureZig Memory System Wink of Stella Brush - 3 Colors Set - Ships Free
$15.71
Zig Memory System Wink of Stella Brush - 3 Colors Set - Ships Free picture5Pcs MMC / SD Short Memory Card Card Socket Card Holder Connector Adapter
$1.26
5Pcs MMC / SD Short Memory Card Card Socket Card Holder Connector Adapter picturePos 1GB DDR2 667 CL5 RAM Memory PC2-5300S-555-12-A0 Ici MT8HTF12864HDY-667E1
$10.0
Pos 1GB DDR2 667 CL5 RAM Memory PC2-5300S-555-12-A0 Ici MT8HTF12864HDY-667E1 pictureSTART INTERNATIONAL TDA150-M Tape Dispenser w/Memory
$4266.57
START INTERNATIONAL TDA150-M Tape Dispenser w/Memory picture






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