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

Power Designs AEC-320-9 PSU 12-Slot Plug-In Mainframe & Display Module 5U
$299.99
Power Designs AEC-320-9 PSU 12-Slot Plug-In Mainframe & Display Module 5U pictureTektronix TM 506 Portable 6-Slot Power Mainframe Chassis w/6x Module Plug-In
$449.99
Tektronix TM 506 Portable 6-Slot Power Mainframe Chassis w/6x Module Plug-In pictureTektronix TM502A Portable Power Supply Module Mainframe Chassis
$70.99
Tektronix TM502A Portable Power Supply Module Mainframe Chassis pictureLeCroy 7200 Portable 2-Slot Precision Digital Oscilloscope Mainframe PARTS
$178.99
LeCroy 7200 Portable 2-Slot Precision Digital Oscilloscope Mainframe PARTS pictureTektronix TM503A 3-Slot Module Mainframe +DM 501A and SC 504 Oscilloscope PARTS
$299.99
Tektronix TM503A 3-Slot Module Mainframe +DM 501A and SC 504 Oscilloscope PARTS picture






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