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
Highlighted
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha
Accepted Solution

java.io.IOException:Tunnel Failed

Hi all,

 

I am trying to debug my application with device by attaching it to JDE. My application uses an HTTP connection. As, I tried to run the application it gives attach:success and the next line is java.io.IOException:Tunnel Failed.

 

I am using a wi-fi connection to connect to Internet. I am successfully able to connect the particular url with BB Browser and also able to open other URL's with Browser, buut my aaplication is not running in device due to this.

 

Can u plz. guide me how to resolve this and run my application. Thnx for the any help.

 

 

 

 

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: java.io.IOException:Tunnel Failed

Have you checked you have the proper data plan for sending and receiving data.

 

Have you gone thru the peter's sticky thread for networking.


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: java.io.IOException:Tunnel Failed

Hi BBDeveloper,

 

Thnx for the quick response.

 

Yeah, I hv checked my plans they are alright as the same plan we are using for other mobiles in our company. And its working fine with them. Its my  first application in BB with http connection, hence I am facing this problem. I think I will hv to go thruthat sticky thread once again.

 

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: java.io.IOException:Tunnel Failed

Yeh suggested is to go thru the thread. If you still ahve the problem you could describe more what you have tried.

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: java.io.IOException:Tunnel Failed

You said:

"I am using a wi-fi connection to connect to Internet."

 

As you will find, if you review the sticky Thread, you need to code the suffix ";interface=wifi" to force use of WiFi. 

 

If the error message mentions tunnel, then typically you are specifying or using by default the direct TCP connection, for which you may need to specify APN values.

 

If you don't resolve the problem yourself, it would be good to know the full URL you are using (especially the suffix), your carrier and the device and OS Level.

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: java.io.IOException:Tunnel Failed

Hi,

 

I hv tried to debug my app again with device, after adding the following method and appending it with my URL.

 

 public static String appendConnectionString()
          {
                    ServiceRecord[] ippprecordArray = ServiceBook.getSB().findRecordsByCid("IPPP");
                    if (ippprecordArray == null)
                              return ";deviceside=true";

                    int numRecords = ippprecordArray.length;
                    for (int i = 0; i < numRecords; i++)
                    {
                              ServiceRecord ipppRecord = ippprecordArray[i];

                              if (ipppRecord.isValid() && ipppRecord.getName().equals("IPPP for BIBS"))
                                        return ";deviceside=false;ConnectionUID=" + ipppRecord.getUid();
                    }
                    return ";deviceside=true";
          }

 

Now, it throws an uncaught exception with value: @63EA8000 and Type: unknown(net_rim_cldc-14,19). Plz. help me to resolve. This is urgent.

 

 

 

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: java.io.IOException:Tunnel Failed

I'm confused by your connection string logic, it doesn't seem to match anything I use.  Where did you get it from?

 

Have you looked at: 

 

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/800451/800563/What_Is...


It has different logic for determining the ConnectUID.

 

So you need to check that your code is valid.

 

That aside, you should be able to give us more that you have about the Exception.  For example, the Exception will have a detail message and it will be associated with a specific line.  If you are debugging on the device and have a consistent level of software, the on device debugging should indicate the line that has the Exception as well.

 

What you have given us is not enough sorry.

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: java.io.IOException:Tunnel Failed

Hi,

 

I m trying to fight with this since yesterday and back to home(forum), as I hv tired of all above. And plz. help me to get rid of this.. Smiley Sad I think there is no problem with my code, bcoz I am not able to connect with other http applications on my device, not even HttpDemo in samples. All give the same exception Tunnel Failed...!!

 

Plz plz help..

 

 

 

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 211
Registered: ‎04-29-2009
My Device: Not Specified

Re: java.io.IOException:Tunnel Failed

[ Edited ]

Have a look

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=60394&view=by_date... 

 

I had same problem "Tunnel Failed"

 

It was solved by changing the carrier...try switching to other network provider. And give proper APN. 

Message Edited by tejaswini on 09-23-2009 05:26 PM
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: java.io.IOException:Tunnel Failed

Hi Tejaswini,

 

I am using Airtel, with no data plans and using Wifi connection of my company for internet connectivity.

 

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro