Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
Blanc
Posts: 638
Registered: 07-02-2009

Tunnel Failed + HttpOcnnection + Wi-Fi.

 

Am using storm device.

 

I got this error "Tunnel Failed" when i try to run establish the http connection. i searched through the forums and am tired but i didnt find any solution,

 

this is my code snippet...

				HttpConnection conn = (HttpConnection) Connector.open("http://server/BBBI/Default.aspx?CategoryName=abc&Item=789&Quantity=10;interface = wifi");
				inputstream = conn.openDataInputStream();

 

In simulator it is working fine. But coming to device it is not working and am thrown into deep trouble. plz somebody help me. i gone through the threads in the forums but no luck, yet!!!!!

 

 

I tried to run the HTTPDemo also, but it is also not working giving the same error.

 

 

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
Posts: 1,474
Registered: 04-14-2009

Re: Tunnel Failed + HttpOcnnection + Wi-Fi.

I suggest you drop the spaces around the '=' in the interface=wifi. It should be "...;interface=wifi".

Please use plain text.
Developer
Blanc
Posts: 638
Registered: 07-02-2009

Re: Tunnel Failed + HttpOcnnection + Wi-Fi.

ya i tried with that but no luck, even in the simulator it is giving tunnelfailed exception. It is not working in the simulator even!!!!

HttpConnection conn = (HttpConnection) Connector.open("http://server/iphone/getCategories.php;interface=wifi");

 

 

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
davidmccormack
Posts: 168
Registered: 11-01-2008
My Carrier: Meteor (Ireland)

Re: Tunnel Failed + HttpOcnnection + Wi-Fi.

Is the server local or remote to the device? If local, is its name resolvable using DNS? What happens if you use the local IP address for the server instead of the name?

Please use plain text.
Developer
Posts: 1,474
Registered: 04-14-2009

Re: Tunnel Failed + HttpOcnnection + Wi-Fi.

OK. Try appending ";deviceside=true" to the URL just to make sure. So, "...;interface=wifi;deviceside=true". Not sure if it'll help though.

Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: Tunnel Failed + HttpConnection + Wi-Fi.

[ Edited ]

Correction:  "interface=wifi" is supported on SImulators for devices that support wifi.  I'm hoping klyubin will post the instructions, which I have just used to enable it.

 

I originally said it was not, which prompted the following posts. 

 

Also you should not add ";deviceside=true" to ";interface=wifi".  There is no need to and I think it is potentially dangerous, because I suspect that some of the device's connection processing will pick up on ";deviceside=true" and will attempt to use wireless rather than WiFi processing.  This will give you a tunnel failure.

 

Finally, but possibly most importantly, if you are not using Storm 2, you don't have WiFi - and that probably explains the tunnel failure - it is trying direct TCP. 

 

If you have got a Storm 2, what do you think of it.

Please use plain text.
Developer
Posts: 1,474
Registered: 04-14-2009

Re: Tunnel Failed + HttpConnection + Wi-Fi.

peter_strange, interface=wifi is not just supported on many simulators (e.g, the Bold 9000 or Curve 8900 to name a few), but actually works as expected (connections go via the simulated WiFi network, as opposed to the simulater cellular network). Are you talking about a particular simulator where interface=wifi is not supported?

Please use plain text.
Developer
Posts: 1,474
Registered: 04-14-2009

Re: Tunnel Failed + HttpConnection + Wi-Fi.

P.S. I can also confirm that the deviceside=true + interface=wifi combo works just fine on simulators that support WiFi and on devices that support WiFi.

Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: Tunnel Failed + HttpConnection + Wi-Fi.

[ Edited ]

Thanks for updating this klyubin.  I will correct my post regarding wifi in Simulators once I've done some testing.  I was sure I had tested it and it didn't work, but that was a long time ago with the first WiFi devices (8320 etc).

 

I still stand by the comment about not using ";deviceside=true" on the real devices, I would not code it, regardless of whether it works or not.  I think I have tested on all WiFi enabled devices, and ";interface=wifi" by itself, works on them all.

Please use plain text.
Developer
Posts: 1,474
Registered: 04-14-2009

Re: Tunnel Failed + HttpConnection + Wi-Fi.

[ Edited ]

peter_strange, I'm curious whether there is a particular reason why you don't like the interface=wifi and deviceside=true combination? I'm not aware of any clear documentation on whether this combination is allowed. At the same time I don't recall any definitive documentation about interface=wifi. Does interface=wifi mean IP over WiFi, or does it just mean that whatever the connection type is requested using other paramers (e.g., MDS, BIS-B, Direct TCP) should be routed via WiFI (there's interface=cellular too!)? I personally have favoured the second explanation, which leads to deviceside=true + interface=wifi, just to make sure it's device-generated TCP/IP or UDP/IP over WiFi.

Please use plain text.