Tunnel failed... :(

Hi guys...

I am facing problem connecting...  I run server and client on the same system his job very well.

but when I run the server on the network and the client on any other machince, there's the message came on the client side when connecting...

"Tunnel failure.."

even I have check the network and do try to systems boths ping them no problem Ping.

See that's my Server Code located in J2se

providerSocket = new ServerSocket(2000);

System.out.println("Waiting for connection");

connection = providerSocket.accept();

System.out.println("Connection received");

//3. get Input and Output streams

out=new DataOutputStream(new BufferedOutputStream(connection.getOutputStream()));

in=new DataInputStream(new BufferedInputStream(connection.getInputStream()));
do{
   try{
    byte b[]=new byte[1024];
    in.read(b);
    message = new String(b);
    if(message.equals("501"))
    sendMessage("hello some message");
    else
    sendMessage("601");
    System.out.println("client>" + message);
    }
    catch(Exception ex){
    System.err.println("Exception in do while : "+ex.getMessage() );
    }
  }while(!message.equals("bye"));

This is the code running on blackberry client-side...

Try

requestSocket = (SocketConnection) Connector.open("socket://176.249.0.17:2000;deviceside=true", Connector.READ_WRITE);

Tags: BlackBerry Developers

Similar Questions

  • Problem with HttpConnection when it connects only not to wifi - java.io.IOException: Tunnel failed

    Hi all

    I develop an application that communicates with a database MySQL via PHP stored on the server scripts. Until today I've developed using the Simulator, and everything has been fine. I now started to test on a device and, while being connected to wifi, everything is still fine. However, the minute I turn off wifi and let the network provider, O2 UK, I get:

    "Request failed: reason: java.io.IOException: Tunnel failed".

    The source of the connection code is as follows:

       public void run() {
           // The following code will only build under JDE 4.5 and later
    
           try {
               String connectionParameters = "";
               // JDE 4.3 is required to get WLANInfo
               if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
                   // Connected to a WiFi access point
                   connectionParameters = ";interface=wifi";
               } else {
                   int coverageStatus = CoverageInfo.getCoverageStatus();
                   ServiceRecord record = getWAP2ServiceRecord();
                   if (record != null
                           // In JDE 4.5 CoverageInfo changed the name of
    COVERAGE_CARRIER to COVERAGE_DIRECT
                           // The constant value for both is the same,
    '1', so you can use that to avoid any
                           // dependency on JDE 4.5
                           && (coverageStatus & CoverageInfo.COVERAGE_DIRECT) ==
                           CoverageInfo.COVERAGE_DIRECT) {
                       // Have network coverage and a WAP 2.0 service book record
                       connectionParameters = ";deviceside=true;ConnectionUID="
                               + record.getUid();
                   } else if ((coverageStatus & CoverageInfo.COVERAGE_MDS) ==
                           CoverageInfo.COVERAGE_MDS) {
                       // Have an MDS service book and network coverage
                       connectionParameters = ";deviceside=false";
                   } else if ((coverageStatus & CoverageInfo.COVERAGE_DIRECT) ==
                           CoverageInfo.COVERAGE_DIRECT) {
                       // Have network coverage but no WAP 2.0 service book record
                       connectionParameters = ";deviceside=true";
                   }
               }
    
               // Pop up a dialog showing the parameters chosen
               UiApplication.getUiApplication().invokeLater(
                       new DialogRunner("Connection Params: "
                               + connectionParameters));
    
               HttpConnection connection = (HttpConnection) Connector.open(url
                       + connectionParameters);
    
               connection.setRequestMethod(method);
               if (method.equals("POST") && postData != null) {
                   connection.setRequestProperty("Content-type",
                           "application/x-www-form-urlencoded");
                   OutputStream requestOutput = connection.openOutputStream();
                   requestOutput.write(postData);
                   requestOutput.close();
               }
               int responseCode = connection.getResponseCode();
               if (connection instanceof HttpsConnection) {
                   HttpsConnection secureConnection = (HttpsConnection) connection;
                   String issuer = secureConnection.getSecurityInfo()
                           .getServerCertificate().getIssuer();
                   UiApplication.getUiApplication().invokeLater(new
    DialogRunner("Secure Connection! Certificate issued by: " + issuer));
    
               }
               // Really you should check for more than just HTTP_OK
               if (responseCode != HttpConnection.HTTP_OK) {
                   screen.requestFailed("Unexpected response code: "
                           + responseCode);
                   connection.close();
                   return;
               }
    
               String contentType = connection.getHeaderField("Content-type");
               ByteArrayOutputStream baos = new ByteArrayOutputStream();
    
               InputStream responseData = connection.openInputStream();
               byte[] buffer = new byte[10000];
               int bytesRead = responseData.read(buffer);
               while (bytesRead > 0) {
                   baos.write(buffer, 0, bytesRead);
                   bytesRead = responseData.read(buffer);
               }
               baos.close();
               connection.close();
    
               screen.requestSucceeded(baos.toByteArray(), contentType);
           } catch (IOException ex) {
               screen.requestFailed(ex.toString());
           }
       }
    

    I scoured these forums and tried everything I can find. I tried different settings, including changing the APN settings both wap and mobile options for O2. Nothing seems to solve this problem.

    Any help would be appreciated!

    Thank you

    Jack

    OK, good news. Fixed. Thanks a lot for your answers. I would have understood the connection settings as they appear to have been the problem.

    I don't remember exactly which it generated, but I decided to try replacing it with the generator of connectionParameter above with the snippet connSuffix here:
    http://supportforums.BlackBerry.com/T5/Java-development/connecting-your-BlackBerry-http-and-socket-c...

    Worked like a dream, so I'm very indebted to all those who contributed to this. It now seems to work little matter the type of connection is available including BES.

    In case anyone is interested, however, I tried all combinations of settings APN bloody O2, but it came to nothing. I am disappointed that it was the connection settings I developed that a book by Apress, and I followed this particular part, Word for Word.

    Thank you all for the world of useful information here!

  • ASA5505 with 2 VPN tunnels failing to implement the 2nd tunnel

    Hello

    I have an ASA5505 that currently connects a desktop remotely for voip and data.  I added a 2nd site VPN tunnel to a vendor site.  It's this 2nd VPN tunnel that I have problems with.  It seems that the PHASE 1 negotiates well.  However, I'm not a VPN expert!  So, any help would be greatly appreciated.  I have attached the running_config on my box, debug (ipsec & isakmp) information and information about the provider they gave me today.  They use an ASA5510.

    My existing VPN tunnel (which works) is marked 'outside_1_cryptomap '.  It has the following as interesting traffic:

    192.168.1.0/24-> 192.168.3.0/24

    192.168.2.0/24-> 192.168.3.0/24

    10.1.1.0/24-> 192.168.3.0/24

    -> 192.168.3.0/24 10.1.2.0/24

    10.1.10.0/24-> 192.168.3.0/24

    10.2.10.0/24-> 192.168.3.0/24

    The new VPN tunnel (does not work) is labeled "eInfomatics_1_cryptomap".  It has the following as interesting traffic:

    192.168.1.25/32-> 10.10.10.83/32

    192.168.1.25/32-> 10.10.10.47/32

    192.168.1.26/32-> 10.10.10.83/32

    192.168.1.26/32-> 10.10.10.47/32

    Here's the info to other VPN (copy & pasted from the config)

    permit access list extended ip 192.168.1.26 eInfomatics_1_cryptomap host 10.10.10.83

    permit access ip host 192.168.1.25 extended list eInfomatics_1_cryptomap 10.10.10.83

    permit access ip host 192.168.1.25 extended list eInfomatics_1_cryptomap 10.10.10.47

    permit access list extended ip 192.168.1.26 eInfomatics_1_cryptomap host 10.10.10.47

    Crypto ipsec transform-set esp-SHA-ESP-3DES-3des esp-sha-hmac

    life crypto ipsec security association seconds 28800

    Crypto ipsec kilobytes of life - safety 4608000 association

    card crypto outside_map 1 match address outside_1_cryptomap

    peer set card crypto outside_map 1 24.180.14.50

    card crypto outside_map 1 set of transformation-ESP-3DES-SHA

    card crypto outside_map 2 match address eInfomatics_1_cryptomap

    peer set card crypto outside_map 2 66.193.183.170

    card crypto outside_map 2 game of transformation-ESP-3DES-SHA

    outside_map interface card crypto outside

    crypto isakmp identity address

    crypto ISAKMP allow outside

    crypto ISAKMP policy 10

    preshared authentication

    3des encryption

    sha hash

    Group 2

    life 86400

    tunnel-group 24.180.14.50 type ipsec-l2l

    IPSec-attributes tunnel-group 24.180.14.50

    pre-shared key *.

    tunnel-group 66.193.183.170 type ipsec-l2l

    IPSec-attributes tunnel-group 66.193.183.170

    pre-shared key *.

    Thanks in advance

    -Matt

    Hello

    The seller put a parameter group2 PFS (Perfect Forward Secrecy) of Phase 2, so that you don't have it.

    So you can probalby try adding the following

    card crypto outside_map 2 pfs group2 set

    I think he'll simply enter as

    card crypto outside_map 2 set pfs

    Given that the 'group 2' is the default

    -Jouni

  • Tunnel TCP fails BlackBerry "BOLD"

    Hi guys, im a moment difficult for 5 days, my problem is that im getting an IO error Tunnel fail when I try a direct TCP using the following sentence, I have confirmed with the carrier (Telcel) the apn settings are ok.

    Conn = (HttpConnection) Connector.open ("http://myweb.com/insert.php;deviceside=true;apn=internet.itelcel.com;") TunnelAuthUsername = webgprs; Tunn...", _urlParametros.getBytes ());

    Play with the url I've changed the sentence for this

    Conn = (HttpConnection) Connector.open ("http://myweb.com/insert.php;deviceside=true;apn=blackberry.net;", _urlParametros.getBytes ());

    and I got io Timed Out

    any clue?

    My device is a BlackBerry "BOLD", and I want to know if it's a problem with my camera, the carrier or my code. I have tryied many changes and unsuccessfully, Im able to navigate the web and TCP configurations in the advanced options are ok.

    I have already downloaded diagnostic tool to test direct TCP ports and the test fails also.

    Thank you for your help and your support.

    Alejandro

    I already solved the problem. The carrier had mixed up my package full Bis with another called Mixto, Telcel ignored mixto is not "compatible" with full Bis until I anoyed them and explained the problem to the STI guy directly. Mixto disables access bis complete apn. Laughing out loud

    Thank you to everyone.

  • http connections fail after removing an application via the BES

    This is consistent - happened on three different phones.

    Measures taken since the BES

    1 deploy an application that uses an HTTP (definition of a custom policy of IT) through the BES connection. Everything works fine

    2 remove the app (by its configuration was rejected.)

    3. assign the policy to the default device

    4 configuration of the software place the device no

    5 deploy

    5. wait and check that app has been removed from the default value of advertising device it in place policy

    Now, the unit measures

    1. install the app even through Javaloader - now http connections fails

    On the curve (Rogers)

    java.io.IOException: Tunnel failed

    on Tour (Verizon)

    javax.microedition.io.ConnectionNotFoundException: Protocol not found: net.rim.device.cldc.io. "http. Protocol

    Any ideas?

    Turns out I had put extra quotes in my url string. It works fine now.

    This diagnostic network (DB-00684) tool was very useful.

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

  • HttpConnection IOException Tunnel has no problem

    Hello

    I wrote a code that use HTTPConnection to call a url:

    HttpConnection conn = (HttpConnection) Connector.open)

    «http:// *.» ***. : 5556/mobileservice.asmx; deviceside = true; ConnectionTimeout ="+ timeOut, Connector.READ_WRITE, true);

    And I got the IOException:Tunnel Failed on 9000 "BOLD" and the 8900. (So far, I had only to test on both devices).

    I think I had put the apn correctly. So I don't understand the reason for this exception.

    Can someone give me help?

    Thanks in advance

    Sorry, my mistake. I used the wrong NPC. I use .com but not .nl.

    And it works now.

    Thanks for your help

  • BIS? Tunnel does not have?

    Currently, I conducted a simple BB app that works like deisgned to my handheld via T-Mobile. I am facing the problem where this application is tested in another country and receiveing an IOException Tunnel failed error message.

    I just realized that the APN settings are OK! for TMobile. However out of the USA, the APN info are not defined or do not work for the carrier.

    Y at - it everywhere where I could get my code filled or my .cod signed that would allow me to use the Blackberry Internet Service to establish the connection. I am a new developer and will not be able to participate in the program of the alliance.

    Is it more to do this?

    Best regards
    Matthew gerard

    Please read Peter «Networking in Blackberry» guide

    Its the best wire/document on these issues. It has links to all the relevant articles KB etc.

    http://supportforums.BlackBerry.com/T5/Java-development/connecting-your-BlackBerry-http-and-socket-c...

    -MO.

  • Tunnel has no exception.

    When I a 9380 Curve off the power, remove the battery and turn the phone on again, my request is unable to establish a connection via the TCP_CELLULAR transport network.

    When I deactivated and activated cellular Transport of the home screen, the connection succeeds. The application runs on other phones and simulators.

    The earpiece of the attempt first calls the attemptFailed method and passes an exception "The Tunnel failed", then the ConnectionFactory returns a null handle.

    The application is built using JDK 5.0.

    My questions:

    Why the transport fails when it is available and in the coverage?

    How to discover what causes the ConnectionFactory to return a null ConnectionDescriptor value?

    Hendre

    Well, you could open a topic in JIRA on https://www.blackberry.com/jira/secure/Dashboard.jspa
    I expect a lot of reaction if, java bb is sort of stepdaughter neglected with bb10 get it all.

  • Direct TCP - Tunnel connection failure

    Yes, I already read a lot of discussions with the same problem, but unfortunally, I can't solve my problem.

    I tried all this URL

    String url = 'socket://url.com:80; deviceside = true; »

    String url = "socket://url.com:80; deviceside = true; NPA = apnumt.movistar.com.uy.

    and the last one also with "TunnelAuthUserName = movistar; TunnelAuthPassword = movistar.

    String url = 'socket://url.com:21; deviceside = true; »

    String url = 'socket://url.com:4444; deviceside = true; »

    Con StreamConnection = Connector.open (url) (StreamConnection);

    or

    String url = "http://url.com;deviceside=true;"

    String url = "http://url.com;deviceside=true;apn=apnumt.movistar.com.uy".

    and the last one also with "TunnelAuthUserName = movistar; TunnelAuthPassword = movistar.

    HttpConnection con = Connector.open (url) (HttpConnection)

    Yes, I also re-branded the apn, user & password in the options of my camera and I removed also.

    Yes, I hava a data plan and my browser work properly.

    I've always had "Tunnel fail."

    Yes, I hate blackberry.  :/

    EDIT: This can be a problem of my data plan?

    mmm...

    ConnectionFactory cf = new ConnectionFactory();
    ConnectionDescriptor cd = cf.getConnection("http://blackberry.com");
    final String url = cd.getURL();
    HttpConnection con = cd.getConnection();
    UiApplication.getUiApplication.invokeLater(new Runnable(){
              public void run(){
                     Dialog.alert(url);
              }
    });
    

    And printed to the console:

    http://blackberry.com;deviceside=true;ConnectionUID=WAP2 trans2
    

    So, this has been fixed, my browser use wap too.

  • java.io.IOException:Tunnel down in a call to url

    Hello

    I wrote a code that use HTTPConnection to call a url:

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

    It's ok in my Pearl and send the url correct, but on "BOLD" my friend, I caught this exception:
    java.io.IOException:Tunnel Failed

    I also test who call for help

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

    and

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

    but it's the same.

    Also, I can call the url by bb browser and it's ok.
    I tested the app by WIFI and Edge.
    It's really weird

    Thanks in advance

    You must understand the functioning of connections of BB.

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

    BTW, this is a double post on the BB developer forum, where I also answered your question.

  • Tunnel VPN failure traps

    Does anyone know if an ASA5505 sends a trap when / if a L2L tunnel fails?

    We are about to use the L2L tunnel as our backup route and it would be really nice if we had notification when / if the tunnel down.

    You have got it. Which for webvpn/anyconnect. I'm sure that for the L2L tunnels it has already activated (and not seen in the \windows\system32\conifg\system).

  • BlackBerry Smartphones Tunnel failure message...

    Hello

    I have problems to run an application downloaded on my Torch. Initially just got a statement saying "APN not specified" I haver spent most of the morning going through the various forums of o2 and found their codes (APN = wap.o2.co.uk, username = o2wap, password = password).

    Now, when I run the application, I get a simple message that says "the Tunnel failed '.

    Can someone help me to go beyond that? I'm not a programmer...

    Thank you very much

    Confirm that the APN settings are saved and always present when you entered the now to do a simple reboot on the BlackBerry this way:

    With the BlackBerry powereddevice, remove the battery for a minute and then reinsert the battery to restart. A reboot in this way is prescirbed for most the gltiches and operating system errors, and you will lose any data on the device doing so.

    Now try to run your application again.

  • VPN fails under W8 on some networks but not others

    I'm back to an Institute that I visited last year.  Last year, I was using a Windows 7 machine, and two VPN services that I use worked perfectly.  This year I'm back, but with a machine of Windows 8.  Neither the VPN service works.  Furthermore, I have excluded the problem in network of the Institute, because my wife brought his Windows 7 machine with it, and it still works perfectly.  The problem is subtle: on a side-trip to Berlin, VPN Windows 8 worked well a of the hotel network.

    Here are the two errors I receive, each with a different VPN server:

    1 standard server VPN in Windows 7 on my desktop at home: "error 806: the VPN connection between your computer and the VPN server was not successful...". "He goes on to say that the most common problem is that something is not configured to allow packets to the Protocol GRE Generic Routing Encapsulation ().

    2. the University VPN server: "Error 800: remote connection does not because attempts VPN tunnels failed...". »

    Suggestions?  Thank you.

    Hi Ken,

    The question is more suited in the TechNet forums. So I would say you mention the link and send the request in this forum for better support.

    http://social.technet.Microsoft.com/forums/en-us/w8itpronetworking/threads

    For any information related to Windows, feel free to get back to us. We will be happy to help you.

  • Unable to connect to the VPN

    I can not connect from home (Windows 7 Starter Edition) at the office of the wife (WinXP Home) via a VPN connection.

    Follow-up of the installation a new connection wizard. Unable to connect with the new account (done in the vpn Wizard. Unable to connect with an existing account on the server VPN system either. I am able to connect from another system of home to the system that hosts the server VPN using pcAnywhere.

    Or the other attempt gives an error 800 - VPN tunnel failed.

    Any ideas on where to start looking?

    I can not connect from home (Windows 7 Starter Edition) at the office of the wife (WinXP Home) via a VPN connection.

    Follow-up of the installation a new connection wizard. Unable to connect with the new account (done in the vpn Wizard. Unable to connect with an existing account on the server VPN system either. I am able to connect from another system of home to the system that hosts the server VPN using pcAnywhere.

    Or the other attempt gives an error 800 - VPN tunnel failed.

    Any ideas on where to start looking?

    See this section of the RRAS team blog...

    http://blogs.technet.com/rrasblog/archive/2009/08/12/troubleshooting-common-VPN-related-errors.aspx

    More than likely the XP box is behind a firewall/router which does not pass traffic GRE protocol 47 . You can test the VPN PPTP link by running the test detailed in the traffic VPN PPTP Ping and secitons on this page.

    http://TechNet.Microsoft.com/en-us/library/bb877965.aspx

    GRAP the pptpsrv.exe and pptpclnt.exe programs on the internet or from a CD of XP SP2. If the tests fail work arounds include...

    * Update the firmware on the router to a version known to pass traffic GRE protocol 47.

    * Flashing the router, if supported, with third-party firmware like DD - WRT that supports passing traffic GRE protocol 47.

    * Buying a router known to pass the GRE protocol traffic.

    * Use an alternative such as Secure Shell [SSH] and a free SFTP client such as WinSCP or TBM for secure remote access to files and folders or Remote Desktop/access control to computers on office's LAN.
    MS - MVP Windows Desktop Experience, "when everything has failed, read the operating instructions.

  • Settings of the AFN for a direct TCP (3G v.s. GPRS) connection

    Today, I read a lot of articles about the transportation options for the Blackberry network.

    I installed the Tool of Network Diagnostics on my device (BlackBerry 9300 v5.0).

    I'm Tournai on "Mobile network" and disabled the "WiFi". Therefore, my device must use the direct TCP (HTTP protocol) only.

    According to this article, for a cell TCP connection, we need to set up the APN settings, otherwise we will have 'Tunnel failed' error

    http://docs.BlackBerry.com/en/developers/deliverables/21128/Network_transport_options_1293321_11.jsp

    However, without specifying the AFN, I was still able to have labour Direct TCP (HTTP).

    I'm in New Zealand, I tested the Network Diagnostic tool with 2 dgree and vodafone sim cards. Two of them work properly. Two of them are 3 G networks

    However, a lot of people on the internet saying that if they do not specify the APN for GPRS or EDGE networks, they would get the error "failure of Tunnel.

    So, I had the impression that with 3G networks, don't need us to specify the APN.

    I don't know if that's okay?

    One of the really annoying things on the treatment on the Blackberry network is its inconsistency.  I think you've hit one of them.  I saw this in the past with Vodafone, I wasn't sure that this has happened with other networks but maybe so.

    The inconsistency is the following.

    If your connection URL looks like

    http://...; deviceside = true

    If you think that this will force the connection to use the carrier TCP aka Direct TCP.  However, on some phones of brands, including Vodafone, is not correct.  On these phones a connection as it goes actually on WAP.

    To force the direct TCP, you must follow the instructions in this post:

    http://supportforums.BlackBerry.com/T5/Java-development/Vodafone-UK-direct-TCP/m-p/463081#M92387

Maybe you are looking for