07-13-2010 02:55 AM
I just copy pasted the code from
and changed nothing except (of course) URL "http://www.example.com" to "http://www.google.com"
and I dont know why i am getting exception
net.rim.device.api.io.ConnectionClosedException: Not connected
on line final int iResponseCode = httpConn.getResponseCode();
this similar exception also occus when I tried to open www.google.com or any other site (other than www.blackberry.com) from the sample application, Network Api Demo, provided with Blackberry JDE.
07-16-2010 02:04 PM
Yes, I think we all faced this problems.
07-18-2010 08:38 PM
I had the same problem at first. But I found the problem was caused by a breakpoint in my IDE on the line that reads the Http response code. When I removed the breakpoint, the problem never occurred again. I started thinking that perhaps the Http connection dies if no data transfer (such as reading response code) takes place in a certain amount of time.
Let me know if that helps.
07-19-2010 01:15 PM
Are you able to open the same URL using the BlackBerry Browser? What BlackBerry Smartphone model and BlackBerry device software version are you testing on? You can find this under Options, About on the BlackBerry Smartphone.
07-25-2010 03:22 PM
Yes, the URL works fine on the browser. My problem is with the simulator. I'm using the 9550 simulator from Eclipse plugin 126.96.36.199. I have not tried running this on an actual phone with a breakpoint. If works fine on the phone without a breakpoint.
07-26-2010 09:54 AM
Do you see activity in the MDS-CS Simulator window when your application attempts to make the connection? Are you using any additional parameters in your URL (i.e. deviceside=true)?
07-26-2010 06:35 PM
I don't see any activity in the MDS window. And yes, the ConnectionFactory instance appended deviceside=true to the URL, according to the ConnectionDescriptor instance.
I only see a problem if I let the simulator pause for awhile on the line where I read the connection's response code. I didn't time exactly what "awhile" is -- probably about 30 seconds.
07-27-2010 03:15 PM
deviceside=true forces a direct TCP connection, which would not go through the MDS-CS Simulator. It is expected to not see any activy in the MDS-CS Simulator window for this type of connection.
Do you have a proxy server in your environment? If so, you will be unable to test a direct TCP connection using the BlackBerry smartphone simulator. You'll need to use a connection through the MDS-CS Simulator instead (deviceside=false) and configure the MDS-CS Simulator to connect through your proxy server.
Configure the BlackBerry MDS simulator to work behind a proxy
07-29-2010 01:44 AM
First of all i am facing this issue all the time, whether or not i am debugging, and secondly i have already configured MDS for my proxy, i can access any page through simulator browser, but not throught a connection by connection factory. the most confusing thing is that you can open www.blackberry.com from same program but as you try to open any other (say www.google.com) it give this error (as i described earlier). I have tried connector.open() and it works fine.