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

New Developer
Posts: 2
Registered: ‎09-25-2008
My Device: Not Specified
Accepted Solution

java.io.IOException:Tunnel Failed in a url calling


I have written a code that using HTTPConnection to call a url:

HttpConnection conn = (HttpConnection) Connector.open(url);
int respCode = conn.getResponseCode();

it's ok in my Pearl and send the url correct, but on my friend's Bold, i caught this exception:
java.io.IOException:Tunnel Failed

I also test calling that by using

StreamConnection c = null;
InputStream s = null;
try {
c = (StreamConnection) Connector.open(url);
s = c.openInputStream();


ContentConnection c = null;
DataInputStream dis = null;
try {
c = (ContentConnection) Connector.open(url);
int len = (int) c.getLength();
dis = c.openDataInputStream();

but the same.

Also i can call the url by bb's browser and it's ok.
I tested the application by WIFI and Edge.
This is really weird Smiley Sad

Thanks in advance
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: java.io.IOException:Tunnel Failed in a url calling

You need to understand how BB connections work.


Please review the sticky thread on communications at the top of this forum.


BTW, this is a duplicate post from the BB Developer forum, where I also answered your question.