Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 23
Registered: ‎01-01-2009
My Device: Not Specified

How to debug HTTPConnection IOException: Failed to transmit

I am attempting to run the Blackberry HTTP demo that comes with the JDM on my 8800.  It works perfectly the JDE simulator (with the MDS simulator running).  But when I sign it and run it on my device the call to .getResponseCode() or any other action invoking statement returns with "IOException: Failed to transmit".

 

Other apps on the device work fine, and this is the sample as provided by RIM so I don't think it is a problem with the code so I am guessing there is a configuration problem most likely with the security settings on the device.

 

So my question is, how do I debug this?  I am completely stumped and am not sure how to find the culprit.

 

As always, any help at all would be greatly appreciated. Smiley Happy

 

-- Henry

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to debug HTTPConnection IOException: Failed to transmit

Use class net.rim.device.api.system.EventLogger class to log into real device log.

 

To open device log on the device screen do the following:

 

Press and hold Alt key and press the key sequence LGLG

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to debug HTTPConnection IOException: Failed to transmit

This is a hard one.  Let us try a few obvious things first.

 

I presume that you are developing using a level of JDE is compatible with the 8800.  From memory, if you have not upgraded it, the 8800 will run 4.2.1, so you should be using JDE 4.2.1 or earlier.

 

Is your 8800 a BES or BIS device?

 

I presume in the http demo, you are NOT using the wap options, so you will not be suffixing a connection parameter to the URL.  This means you will be using the HandHeld's default connection, which I believe to be via MDS if BES phone (in which case you need do nothing), or direct TCP if it is a BIS phone.  For direct TCP, you will need to code APN parameters specific to your carrier.

 

You will find more in the following:

What Is - Different ways to make an HTTP or socket connection
Article Number: DB-00396
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/796557/800451/800563/...

You might also find this tool very useful:

What Is - Network Diagnostic Tool
Article Number: DB-00684

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

 

This is written for 4.5 devices, but there are comments on the bits you need to remove to get it working on previous levels.  But I think this is a last resort.

New Developer
Posts: 23
Registered: ‎01-01-2009
My Device: Not Specified

Re: How to debug HTTPConnection IOException: Failed to transmit

Thank you both for all the information.  I now have something to go on. Smiley Happy

 

New question:

So when you download an application, like Google Maps, does the application handle detecting what type of connection it is using (MDS vs BIS vs TCP, ...), or is the user expected to fill in some values in an options menu?

 

 

Three quick questions:

1) Is using the event logger just a way for me to output data?  If so I can just do it over debug output.  Or is it possible that the TCP stack will actually dump useful information in there?

 

2) BES vs BIS.  I'm new to Blackbery, but my understanding was that BES is using an enterprise server, and BIS is just using the default Blackberry internet service?  If so, this is most likely a BES device because I got it from somebody who worked at a company previously.  Is there an easy way to check?  Do all apps which use the internet check for this?

 

3) Everything else is aligned.  Will code built for a newer version of the OS even run downlevel?  If so you've just added testcases to my test mix. Smiley Tongue

 

Thank you so much for the incredibly prompt responses.  Now I have something to read / work on. Smiley Happy

 

-- Henry

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to debug HTTPConnection IOException: Failed to transmit

Use Throwable instead of Exception in catch() section into try-catch structures. It preserves exception stack trace.

 

Use of EventLogger is just an additional way to log data. You also can use your own debug-mechanisms.

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to debug HTTPConnection IOException: Failed to transmit

Code build on a high level of JDE will not run on a lower level of OS on a device. TO run on 4.2.1, you must be compiling using 4.2.1 or lower.

 

 

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: How to debug HTTPConnection IOException: Failed to transmit

You "should" be able to get reliable connectivity if you pay your carrier for digital service by using ";deviceside=true"

However, I recall getting a similar throw problem when I changed the parameter to get around some

carrier limitations. You may want to try this as I don't think I've seen this response from the carrier.

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to debug HTTPConnection IOException: Failed to transmit

Just summarizing the above into one place and answering your questions directly:

 

1) Is using the event logger just a way for me to output data?  If so I can just do it over debug output.  Or is it possible that the TCP stack will actually dump useful information in there?

 

The Event Logger is just a log that applications (RIm and 3rd party) can write data into.  You should use to for debugging output.  Entrapped exceptions write useful stuff into it.  If you catch an exception then you are responsible for putting data into there, hence the comments from tbilisoft above.

 

In my experience the TCP stack does not put anything in there that a 3rd party can make sense off.  No doubt Rim can.

 

2) BES vs. BIS.  I'm new to Blackberry, but my understanding was that BES is using an enterprise server, and BIS is just using the default Blackberry internet service?  If so, this is most likely a BES device because I got it from somebody who worked at a company previously.  Is there an easy way to check?  Do all apps which use the internet check for this?

 

Your understanding on BIS/BES is correct.  I'm going to admit ignorance here and I don't know if there is any easy way to check if you have a BIS verses BES device, but the difference is actually down to the Service Books that your Carrier sends to the Phone.  If you have re-enabled the device with a BlackBerry service on your carrier, then the device will probably swap from being DIS to whatever you are, which is probably BIS.  But this question needs input from someone who knows more than I do.

 

3) Everything else is aligned.  Will code built for a newer version of the OS even run downlevel?  If so you've just added testcases to my test mix.

 

As noted by RexDoug, BB code is forward but not backward compatible.

 

Hope this helps.

New Developer
Posts: 23
Registered: ‎01-01-2009
My Device: Not Specified

Re: How to debug HTTPConnection IOException: Failed to transmit

Everybody continues to be very helpful. Smiley Happy

 

One last question then this thread can die.  The Google Maps application works out of the box w/o needing any tweaking from me.  Are applications like this doing some querying on the device to determine what type of connectionto use and then doing the smart thing.  Or is there something else, magical, going on?

 

-- Henry

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to debug HTTPConnection IOException: Failed to transmit

See the API docs for CoverageInfo. You can query the system to determine if you have BIS or BES coverage, or if you can connect via direct TCP.