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
Contributor
Posts: 30
Registered: ‎12-02-2010
My Device: BlackBerry 8520
My Carrier: Mobilink

Re: Critical tunnel failure

Hi all...

I m also getting same type of error..

Here is my code sample:

 

 

public static String getString()
{
 String connectionString = null; 
   
 String uid = null;
 ServiceBook sb = ServiceBook.getSB();
 ServiceRecord[] records = sb.findRecordsByCid("WPTCP");
 for (int i = 0; i < records.length; i++) {
 if (records[i].isValid() && !records[i].isDisabled()) {
 if (records[i].getUid() != null &&
 records[i].getUid().length() != 0) {
 if ((records[i].getCid().toLowerCase().indexOf("wptcp") != -1) &&
 (records[i].getUid().toLowerCase().indexOf("wifi") == -1) &&
 (records[i].getUid().toLowerCase().indexOf("mms") == -1) ) {
 uid = records[i].getUid();
 break;
 }
 }
 }
 }
 if (uid != null)
 {

 connectionString = ";ConnectionUID="+uid;
 }
 else
 {
 // Wifi
 if(WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED)
 {
 connectionString = ";interface=wifi";
 }

 // the carrier network
 else if((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT)
 {
 connectionString = ";deviceside=true";
 } 

 //(BlackBerry Enterprise Server)
 else if((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS)
 {

 connectionString = ";deviceside=false";
 }

 
 }



 

 return connectionString;
 }

i've used this to append url suffix.

I've got my app working on real devices. But on some devices my app shows

" Critical Tunnel Failure. "

I know it is due to Direct TCP connection suffix (deviceside=true) usage.

but in my code I put TCP at the lowest priority.

so what goes wrong at that device.

 

is that device not uses WAP 2.0?


 or some other issues...!!

Please get me out of this problem...

Adil Soomro

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

Re: Critical tunnel failure

Your error suggests that your customer has not added the correct APN values to their TCP Options, or that the customer does not have Direct TCP.  What network are you using when you have this problem?

 

You might find these articles of use, though you will have to redesign your connection code.

 

http://supportforums.blackberry.com/t5/Java-Development/What-Is-Network-API-alternative-for-legacy-O...

 

http://supportforums.blackberry.com/t5/Java-Development/Sample-HTTP-Connection-code-and-BIS-B-Access...