Connection timed out: connect for ebMs messages

Hi
We are facing a problem while posting an outbound message in ebMS. We encounter the following error.
Machine Info: (INBAAMPC00933)
*Transport error: [IPT_HttpSendConnectionRefused] HTTP connection is refused.*
Connection refused: connect
Oracle b2b is used at both the ends. The initiating b2b does not have any certificates, while the receiving b2b has a certificate and 2 Delvery Channels (DCs). One of the DC's does not use certificates and that is the one tied to the agreement. So, Iam assuming this error is not due to the certificates. Could you please help me out in this.
Ranjith

Hi Ranjith,
It seems that receiving B2B or any other front end(like any switch) is expecting the initiating B2B to send message over HTTPS.
Please check whether you are able to ping and telnet the receiving B2B's host name at the port specified in the initiating B2B configuration. Also make sure that this port has HTTP enabled and not HTTPs.
Let us know the result.
Regards,
Anuj

Similar Messages

  • FTPS receiver side - Connection problem:connection timed out: connect

    Hi experts,
    I must connect to an external server to send files with FTPS.
    I have created receiver CC with connection security: FTPS for control and data connection
    Command order: TLS, USER, PASS, PBSZ, PROT
    Connect mode: per file transfer
    port : 990 (given by third part)
    data connection: passive (suggested by third part)
    My problem is that communication channel raise a connection timed out error, see below for log.
    I've already followed the steps suggested by this thread:
    FTPS Transfer Failing with Connection Timeout
    but no luck.
    Thanks
    Fabio Boni
    2011-05-18 12:21:01 Success Connecting to FTP server "ftps.xxx.xxx.it"
    2011-05-18 12:21:02 Success Write to FTP server "ftps.xxx.xxx.it", directory "/in", -> file "Delivery20110518-122102-155.xml"
    2011-05-18 12:21:02 Success Transfer: "BIN" mode, size 1760 bytes, character encoding -
    2011-05-18 12:21:23 Error Attempt to process file failed with java.net.ConnectException: Connection timed out: connect
    2011-05-18 12:21:23 Error Exception caught by adapter framework: Connection timed out: connect
    2011-05-18 12:21:23 Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Connection timed out: connect: java.net.ConnectException: Connection timed out: connect
    2011-05-18 12:21:23 Error Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Connection timed out: connect: java.net.ConnectException: Connection timed out: connect.

    As Fabio said, the file adapter log return this log:
    2011-05-18 12:21:01 Success Connecting to FTP server "ftps.xxx.xxx.it"
    2011-05-18 12:21:02 Success Write to FTP server "ftps.xxx.xxx.it", directory "/in", -> file "Delivery20110518-122102-155.xml"
    2011-05-18 12:21:02 Success Transfer: "BIN" mode, size 1760 bytes, character encoding -
    2011-05-18 12:21:23 Error Attempt to process file failed with java.net.ConnectException: Connection timed out: connect
    Seem that FTP access into server is executed successfully and adapter write file, but raise timeout exception.

  • OpenMarket sms api gives "Connection timed out: connect"

    Hello All,
    I am new to web applications with sms services.
    I am trying to send sms from my java application to mobile device. But I am getting below error.
    Aug 25, 2010 10:55:58 AM com.eha.sms.ema.EMACMMessageSendProxy init
    INFO: Move to send the receiver initialization.
    Destination address = +**********
    Source addres = +*****
    Sending message to Simplewire...
    REQUEST XML ==
    <?xml version="1.0" ?>
    <request version="3.0" protocol="wmp" type="submit">
         <user agent="Java/SMS/2.9.16"/>
         <account id="******************" password="***************"/>
         <option type="production"/>
         <source ton="0" address="+*****"/>
         <destination ton="0" address="+**********"/>
         <message udhi="false" text="Hello World!"/>
    </request>
    protocol: http
    remote host: ******Some site given to us by open market people that opens on browser**********
    remote port: 8080
    remote file: /wmp
    {main} [10:55:58.722] Conn: added module com.simplewire.http.RetryModule
    {main} [10:55:58.725] Conn: added module com.simplewire.http.AuthorizationModule
    {main} [10:55:58.726] Conn: added module com.simplewire.http.DefaultModule
    {main} [10:55:58.747] Conn: Creating Socket: smsc-01.openmarket.com:8080
    {main} [10:56:19.759] Conn: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at com.simplewire.http.HTTPConnection$_A.run(Unknown Source)
    Message was not sent!
    Error Code: 106
    Error Description: A connection could not be established with the Simplewire network. Connection timed out: connect
    Error Resolution:
    The code I am using is as below.
    private void config()
              Properties properties = new Properties();
              InputStream smscmReceiver = EMACMMessageSendProxy.class.getClassLoader().getResourceAsStream("sms.properties");
              try
                   properties.load(smscmReceiver);
                   System.out.println(properties.getProperty("SMS.SubscriberID").trim());
                   System.out.println(properties.getProperty("SMS.Password").trim());
                   System.out.println(properties.getProperty("SMS.DestinationAddress").trim());
                   System.out.println(properties.getProperty("SMS.SourceAddress").trim());
                   SMS sms = new SMS();
                   // subscriber settings
                   sms.setRemoteHost(" ******Some site given to us by open market people that opens on browser**********");
                   sms.setDebugMode(true);
                   sms.setRemotePort(8080);
                   sms.setSubscriberID(properties.getProperty("SMS.SubscriberID").trim());
                   sms.setSubscriberPassword(properties.getProperty("SMS.Password").trim());
                   // Message Settings
                   sms.setDestinationAddr(properties.getProperty("SMS.DestinationAddress").trim());          // recipient of message
                   sms.setSourceAddr(properties.getProperty("SMS.SourceAddress").trim());               // originator of message
                   sms.setMsgText("Hello World!");
                   System.out.println("Sending message to Simplewire...");
                   // submit message and check results
                   if (sms.submit())
                        System.out.println("Message was sent!");
         System.out.println("Ticket ID: " + sms.getMsgTicketID());
                   else
                        System.out.println("Message was not sent!");
                        System.out.println("Error Code: " + sms.getErrorCode());
                        System.out.println("Error Description: " + sms.getErrorDesc());
                        System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
              } catch (IOException e)
              log.error("Load profile sms.properties failed to send Move.", e);
    I am using windows 7 and the required info from the java code is picked up from a property file.
    destination address is a "+" sign followed by cell number of client in US and I am in diff country.
    source code I am using is "+" sign followed by a short code given by client.
    I am also not aware what short codes are for.
    I am also not sure whether I am passing correct parameters.
    I just followed a demo code from the api's sample file. (open market api......swsms-2.9.16 is the jar used.).
    would like to know If destination address can be my cell number.
    The open market people have configured the demo short code for our SMS messaging account.
    This feature will allow us to test our platform to send and receive SMS messages
    while we are waiting for our dedicated short code.
    Mobile Originated messages MUST start with our assigned keyword(s) to be routed to you.
    We have a few keywords but don't know how to use them.
    Please help!
    Thanks in advance.
    Edited by: Vish_1x1 on Aug 24, 2010 11:06 PM

    I had a same problem.
    It was definately URL and SOAP Action Problem.
    Also, I didnt configure the Proxy too.
    Please dont waste more time in looking inot other configs.
    Just give a careful look at Target URL and SOAP Action, again and again.
    Sweta , Please make this question Answerd , it will be useful for other users.
    And Bahvesh Deserves good points..
    Thanks ,
    Deo.

  • Connection timed out: connect at com.sun.mail.imap.IMAPStore.protocolConne

    Hi ,
    Recently, my team need to work with javamail. Here I got a problem: when I run the application in my personal home network , it goes on very well. When I run the program in my company env, it gives error info:
    Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
    nested exception is:
    java.net.ConnectException: Connection timed out: connect
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1706)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)
    at javax.mail.Service.connect(Service.java:313)
    The resource is :
    import java.security.Security;
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    *Use Gmail
    public class GmailSender {
    public static void main(String[] args) throws AddressException, MessagingException {
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
    // Get a Properties object
    Properties props = System.getProperties();
    //Add proxy for GmailSender
    //especially here, I am not sure whether the proxy really works. In home network, it needn't proxy to run successfully.
    // props.setProperty("proxySet","true");
    // props.setProperty("socksProxyHost","148.87.19.20"); // This IP address is our proxy server address
    // props.setProperty("socksProxyPort","80");
    props.setProperty("mail.smtp.host", "smtp.gmail.com");
    props.setProperty("mail.smtp.socketFactory.class", SSL_FACTORY);
    props.setProperty("mail.smtp.socketFactory.fallback", "false");
    props.setProperty("mail.smtp.port", "465");
    props.setProperty("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.auth", "true");
    final String username = "XXX";
    final String password = "XXX";
    Session session = Session.getDefaultInstance(props, new Authenticator(){
    protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(username, password);
    // -- Create a new message --
    Message msg = new MimeMessage(session);
    // -- Set the FROM and TO fields --
    msg.setFrom(new InternetAddress(username + "@gmail.com"));
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse("[email protected]",false));
    msg.setSubject("Hello");
    msg.setText("How are you");
    msg.setSentDate(new Date());
    Transport.send(msg);
    System.out.println("Message sent.");
    Will you please help me to review my code and give me some suggestions ?

    No point looking at the code. The error message says the code can't connect to the server you are trying to connect to, so presumably there's a firewall or something like that preventing the connection. Talk to your network people.

  • G6 UI Customization build problem - Connection timed out: connect

    For anyone else who's having the same problem we're having:
    When I run ANT on the ui customization folder, I get this error:
    Buildfile: build.xml
    BUILD FAILED
    C:\plumtree_ui_source\portalui\6.0.x\test\build.xml:14: The following error occu
    rred while executing this line:
    Error reading project file C:\plumtree_ui_source\portalui\6.0.x\test\build_core.
    xml: Connection timed out: connect
    Total time: 21 seconds
    We're running behind a proxy.  ANT has to connect to the Java website to pull down it's DTD.  So, the answer is to first run the following command to configure the proxy, replacing the proxy host, port, username, and password with yours:
    set ANT_OPTS=-Xms128m -Xmx800m -DproxySet=true -DproxyHost=10.0.0.0 -DproxyPort=80 -DproxyUser=myUsername -DproxyPass=myPassword

    Thanks for the post, it fixed my issue!

  • RMI on Debian: Connection Timed Out: connect

    Hi
    I have a Problem with my RMI Server program running under Debian.
    When i start the server it lasts for about 3 minute until the Object is bound to the RMI-Registry.
    I have a simple System.out.println("XXX bound"); statement after binding the registry.rebind(name, stub);
    Well it seems to work because no exception is thrown and i can see the println.
    But the big problem is, that it takes for about 3 minutes until this is done. when i try to connect to the server via the client,
    i get a
    "Connection refused to host: xxxxx; nested exception is:
    java.netConnectException: Connection timed out: connect"
    after a minute, the serverside doesn't make anything, no System.out statement is executed in the remote method.
    it seems that RMI is very slow on my Server machine and i can't figure out why.
    here are the properties set in the server program:
    System.setProperty("java.rmi.server.codebase", "xxxxxx"); //works
         System.setProperty("java.rmi.server.hostname", "xxxx.ath.cx"); //perhaps the problem
         System.setProperty("java.security.policy", "/var/www/dod/xxxxx.policy"); // should be no problemmy client is startet via webstart from the same server an has the lookup code:
    try {
                   registry = LocateRegistry.getRegistry("xxxx.ath.cx"); //perhaps the problem
                   idodsrmi = (XXXServerRMI) registry.lookup("xxxxxxx");
                   usrh = idodsrmi.getUserHandle(args[0], args[1]);
              } catch (AccessException e) {
                   JOptionPane.showMessageDialog(null, e.getMessage());
                   e.printStackTrace();
              } catch (RemoteException e) {
                   JOptionPane.showMessageDialog(null, e.getMessage());
                   e.printStackTrace();
              } catch (NotBoundException e) {
                   JOptionPane.showMessageDialog(null, e.getMessage());
                   e.printStackTrace();
              } this code is executed without throwing an exception, but when i try to call methods on usrh i get the connection timeout...
    i can't see where the problem is, "xxxx.ath.cx" is the domain name my network is available from outside the lan,
    my router forwards port 80 and 1099 to my serverbox
    any ideas about the timeout?

    Yes that was it, i got the clou when i changed the hostname of my debian-box to xxx.ath.cx. after changing to that hostname i got an exception to google for.. ;-) But it's still strange to get no exception when the hostname of my debian-box differs from the dyndns name. it just lasts for about 3 minutes and seems to work...
    Well now im back to an older problem, my server uses hibernate to communicate with a db and when i make 2 .jars (1 hibernate-util with all hibernate related jars and 1 for my project) instead of 1 big jar with all jars i get the exception "No Persistence provider for EntityManager named DOD", thats a strange behavior too because the persistence.xml is at the same place in my project .jar... :-/

  • [C4003] Connection timed out: connect

    I have i problem when trying to connect to JMS resource through JMSConnection factory on a remote machine. I have standalone client with wich I can connect if a run it on the same machine that AppServer is running. When I try to connect from a remote machine I see SJSMQ JMS Resource Adapter starting... and than i get following error:
    com.sun.messaging.jmq.jmsclient.ExceptionHandler throwConnectionException
    WARNING: [C4003]: Error occurred on connection creation [machinename:7676]. - cause: java.net.ConnectException: Connection timed out: connect
    There are no errors in server log.
    I have set java options -Dorg.omg.CORBA.ORBInitialHost and -Dorg.omg.CORBA.ORBInitialPort when running standalone client.
    I've also created connectionFactory in appServer on client machine that points to remote machine and have succesfully connected to JMS that way.
    So why can't I connect directly to remote machine? Any suggestions?
    Thnx.
    Marko

    No point looking at the code. The error message says the code can't connect to the server you are trying to connect to, so presumably there's a firewall or something like that preventing the connection. Talk to your network people.

  • Connection timed out: connect

    Hi!
    i am trying to read a webpage into a string but i am getting error
    Exception in thread "main" java.net.ConnectException: Connection timed out: connectIs there any socket port related error.....ports below 1024 r blocked in our companies unix server.... if so please tell me the solution...
    Bunty
    Following is my code.
    import java.io.*;
    import java.net.URL;
    import java.awt.*;
    import java.net.*;
    public class urlTest {
                    public static void main(String args[]) throws Exception {
               try  { 
                         URL url = new URL ( "http://www.yahoo.com" ) ;
                      URLConnection urlConnection = url.openConnection (  ) ;
                      BufferedReader htmlPage = new BufferedReader ( new InputStreamReader ( url.openStream (  )  )  ) ;
                   String line = "";
                      while (  ( line = htmlPage.readLine (  )  )  != null )   { 
                                  //do something with the html line
                              htmlPage.close (  ) ;
                             urlConnection = null;
                        }  catch ( Exception e )   { 
                             e.printStackTrace (  ) ;
    }

    You most likely need to connect through a proxy server. Figure out the proxy host, port and used protocol (probably http) and then build your URL like this:
    URL url = new URL("http", "yourproxyhost",  80, "http://www.yahoo.com");Fill in the relevant information (80 is the proxy port in the above example, perhaps you need to fill in another port).
    Hope that solves your problem.

  • Connection Timed Out error while saving messages in Solution Database

    Dear Experts,
    I have configured trex in solution manager..while saving service messages in 'Solution Database' i used to get "page cannot be displayed" now iam getting the fallowing error..please suggest any changes required..
    500 Connection timed out
    Error: -5
    Version: 7000
    Component: ICM
    Date/Time: Thu May 14 15:11:24 2009 
    Module: icxxthr.c
    Line: 2698
    Server: Host_<SID>_<Sys no>
    Error Tag: {-}
    Detail: Connection to partner timed out after 60s
    Regards,
    Babu

    Hi Babu,
    you might try the following on the server where the problem occurred: call transaction SMICM -> Goto Services -> Select the service you are working with ->
    Service Change -> increase value for "Max. Processing Time"
    In case your application still times out you should see the changed value displayed.
    Sometimes just executing the application again 2-4 times might help, because compiling might happen and is taking some time in the system.
    With regards to parameters see also SAP Note [824554|https://service.sap.com/sap/support/notes/824554].
    Best regards,
      Andreas

  • Chat System: ConnectException: Connection timed out: connect

    Hi There,
    I am developing a chat system as part of a University project.
    To explain what I have implemented:
    I have three java classes;
    1. Chat Server class which is constantly listening for incoming socket connection on a particular socket:
    while (true)
    Socket client = server.accept ();
    System.out.println ("Accepted from " + client.getInetAddress ());
    ChatHandler c = new ChatHandler (client);
    c.start ();
    2. Chat Handler class uses a thread for each client to handle multiple clients:
    public ChatHandler (Socket s) throws IOException
    this.s = s;
    i = new DataInputStream (new BufferedInputStream (s.getInputStream ()));
    o = new DataOutputStream (new BufferedOutputStream (s.getOutputStream ()));
    public void run ()
    try
    handlers.addElement (this);
    while (true)
    String msg = i.readUTF ();
    broadcast (msg);
    catch (IOException ex)
    ex.printStackTrace ();
    finally
    handlers.removeElement (this);
    try
    s.close ();
    catch (IOException ex)
    ex.printStackTrace();
    protected static void broadcast (String message)
    synchronized (handlers)
    Enumeration e = handlers.elements ();
    while (e.hasMoreElements ())
    ChatHandler c = (ChatHandler) e.nextElement ();
    try
    synchronized (c.o)
    c.o.writeUTF (message);
    c.o.flush ();
    catch (IOException ex)
    c.stop ();
    3. Chat Client class which has a simple GUI and sends messages to the server to be broadcasted to all other clients on the same socket port:
    public ChatClient (String title, InputStream i, OutputStream o)
    super (title);
    this.i = new DataInputStream (new BufferedInputStream (i));
    this.o = new DataOutputStream (new BufferedOutputStream (o));
    setLayout (new BorderLayout ());
    add ("Center", output = new TextArea ());
    output.setEditable (false);
    add ("South", input = new TextField ());
    pack ();
    show ();
    input.requestFocus ();
    listener = new Thread (this);
    listener.start ();
    public void run ()
    try
    while (true)
    String line = i.readUTF ();
    output.appendText (line + "\n");
    catch (IOException ex)
    ex.printStackTrace ();
    finally
    listener = null;
    input.hide ();
    validate ();
    try
    o.close ();
    catch (IOException ex)
    ex.printStackTrace ();
    public boolean handleEvent (Event e)
    if ((e.target == input) && (e.id == Event.ACTION_EVENT)) {
    try {
    o.writeUTF ((String) e.arg);
    o.flush ();
    } catch (IOException ex) {
    ex.printStackTrace();
    listener.stop ();
    input.setText ("");
    return true;
    } else if ((e.target == this) && (e.id == Event.WINDOW_DESTROY)) {
    if (listener != null)
    listener.stop ();
    hide ();
    return true;
    return super.handleEvent (e);
    public static void main (String args[]) throws IOException
    Socket s = new Socket ("192.168.2.3",4449);
    new ChatClient ("Chat test", s.getInputStream (), s.getOutputStream ());
    On testing this simple app on my local host I have launched several instances of ChatClient and they interact perfectly between each other.
    Although when i test this app by launching ChatClient on another machine (using a wi-fi network connection at home), on the other machine that tries to connect to the hosting server (my machine) i get a "connection timed out" on the chatClient machine.
    I have added the port and ip addresses in concern to the exceptions to by-pass the firewall but i am still getting the timeout.
    Any suggestions?
    Thanks!

    Format your code with [ code ] tag pair.
    If you are a young university student I don't understand why current your code uses so many of
    too-too-too old APIs including deprecated ones.
    For example, DataInput/OutputStream should never be used for text I/Os because they aren't
    always reliable.
    Use Writers and Readers in modern Java programming
    Here's a simple and standard chat program example:
    (A few of obsolete APIs from your code remain here, but they are no problem.
    Tested both on localhost and a LAN.)
    /* ChatServer.java */
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class ChatServer{
      ServerSocket server;
      public ChatServer(){
        try{
          server = new ServerSocket(4449);
          while (true){
            Socket client = server.accept();
            System.out.println("Accepted from " + client.getInetAddress());
            ChatHandler c = new ChatHandler(client);
            c.start ();
        catch (IOException e){
          e.printStackTrace();
      public static void main(String[] args){
        new ChatServer();
    class ChatHandler extends Thread{
      static Vector<ChatHandler> handlers = new Vector<ChatHandler>();
      Socket s;
      BufferedReader i;
      PrintWriter o;
      public ChatHandler(Socket s) throws IOException{
        this.s = s;
        i = new BufferedReader(new InputStreamReader(s.getInputStream()));
        o = new PrintWriter
         (new BufferedWriter(new OutputStreamWriter(s.getOutputStream())));
      public void run(){
        try{
          handlers.addElement(this);
          while (true){
            String msg = i.readLine();
            broadcast(msg);
        catch (IOException ex){
          ex.printStackTrace();
        finally{
          handlers.removeElement(this);
          try{
            s.close();
          catch (IOException e){
            e.printStackTrace();
      protected static void broadcast(String message){
        synchronized (handlers){
          Enumeration e = handlers.elements();
          while (e.hasMoreElements()){
            ChatHandler c = (ChatHandler)(e.nextElement());
            synchronized (c.o){
              c.o.println(message);
              c.o.flush();
    /* ChatClient.java */
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    public class ChatClient extends JFrame implements Runnable{
      Socket socket;
      JTextArea output;
      JTextField input;
      BufferedReader i;
      PrintWriter o;
      Thread listener;
      JButton endButton;
      public ChatClient (String title, Socket s){
        super(title);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        socket = s;
        try{
          i = new BufferedReader(new InputStreamReader(s.getInputStream()));
          o = new PrintWriter
           (new BufferedWriter(new OutputStreamWriter(s.getOutputStream())));
        catch (IOException ie){
          ie.printStackTrace();
        Container con = getContentPane();
        con.add (output = new JTextArea(), BorderLayout.CENTER);
        output.setEditable(false);
        con.add(input = new JTextField(), BorderLayout.SOUTH);
        con.add(endButton = new JButton("END"), BorderLayout.NORTH);
        input.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            o.println(input.getText());
            o.flush();
            input.setText("");
        endButton.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ev){
            try{
              socket.close();
            catch (IOException ie){
              ie.printStackTrace();
            System.exit(0);
        setBounds(50, 50, 500, 500);
        setVisible(true);
        input.requestFocusInWindow();
        listener = new Thread(this);
        listener.start();
      public void run(){
        try{
          while (true){
            String line = i.readLine();
            output.append(line + "\n");
        catch (IOException ex){
          ex.printStackTrace();
        finally{
          o.close();
      public static void main (String args[]) throws IOException{
        Socket sock = null;
        String addr = "127.0.0.1";
        if (args.length > 0){
          addr = args[0];
        sock = new Socket(addr, 4449);
        new ChatClient("Chat Client", sock);
    }

  • HttpUrlConnection: Connection timed out: connect

    I am seeing a small percentage of my customers who cannot connect to my server through my Java program to download program updates. The commonality between the customers is that all (or most) of them seem to be from Australia, but I have some customers in Australia who CAN connect successfully. Probably a red herring.
    The problem is seen when creating a URL connection to a text file to read it. The file contains only 3 lines. Like I said, most users do not have a problem, but some do. Could it be that the connection is actually timing out, and if so, how do I lengthen the timeout? Most users say that they do not even have to wait 5 seconds before the error occurs.
    The user can connect to the URL with a browser and download the files that way, but this is supposed to be an automatic process. They tell me there is nothing wrong with their network. I'm wondering whether they might have a firewall in place, but when I block connections using my software firewall, I get java.net.UnknownHostException instead.
    The code looks roughly like this. I've added printlns recently and have not heard back from the customer with any results.
            String urlString = cUpdateLocation + cUpdateFileName;
             try {
                System.out.println("Create the URL: " + urlString);
                URL url = new URL(urlString);
                System.out.println("Open the URL connection");
                URLConnection urlConn = url.openConnection();
               System.out.println("Get an input stream");
                InputStream inputStream = urlConn.getInputStream();
                System.out.println("Define an input stream reader");
               InputStreamReader iReader = new InputStreamReader(inputStream);
               System.out.println("Define a buffered reader");
                BufferedReader bReader = new BufferedReader(iReader);
               String input = "";
               System.out.println("Read from the buffered reader");
                try {
                    while (input != null) {
                       input = bReader.readLine();
                        if (input != null) {
                            // Ignore blank lines 
                          input.trim();
                            if (input.length() > 0) {
                                System.out.println("input=" + input);
                   System.out.println("Done reading from the buffered reader");
                    success = true;
                } catch (IOException e) {
                   // Catch these IOExceptions here so we can still close the
                    // streams and clean up while we have reference to them
    .                System.out.println("IOException encountered reading from:\n" +
                                      urlString + "\n" + e);
                bReader.close();
            } catch (MalformedURLException e) {
                System.out.println("URL " + urlString + " is malformed.  " +
                                   e.getMessage());
            } catch (IOException e) {
               // This is the exception that I normally see.
                System.out.println("IOException encountered creating stream to " +
                                   "read from:\n" + urlString + "\n" + e);
                e.printStackTrace();

    Did u write the code to handle Proxy server.?
    Though i m not sure but might be clients who are getting error uses proxy server. and other dont have a proxy in their network.
    Iu did not handled proxy u can do this by...
    Properties sysProperties = System.getProperties();
    // Specify proxy settings
    sysProperties.put("proxyHost", "your_proxy_host");
    sysProperties.put("proxyPort", "your_proxy_port");
    sysProperties.put("proxySet", "true");or while running
    use
    java -D option to set these system properties
    hope works
    cheers

  • Connection timed out, Connection timed out

    I get this message whenever I try to get reconnected to known wireless networks, please help.

    i was updating my iphone and it just stopped, now says i have to restore to have phone load, it also just has a plug and the end of a usb showing on face of phone i also will loose all data pics, music if i restore what can i do to get it to connect and upload data to computer/itunes HELP

  • Javax.xml.soap.SOAPException: Message send failed: Connection timed out

    Hi,
    where can i adjust the timeout for:
    exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection timed out: connect
    The webservice needs 5min to return a message....
    I found a duplicate of this on thread:
    error initiating a test instance
    But no answer
    Message was edited by:
    HEWizard

    I found http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/events.htm#BABGGADB
    Setting Timeouts for Synchronous Processes
    For synchronous processes that connect to a remote database, you must increase the syncMaxWaitTime timeout property in the SOA_Oracle_Home\bpel\domains\default\config\domain.xml file:
    <property id="syncMaxWaitTime">
    <name>Delivery result receiver maximum wait time</name>
    <value>60000000</value>
    <comment>
    <![CDATA[The maximum time the process result receiver will wait for a
    result before returning.  Results from asynchronous BPEL processes are
    retrieved synchronously via a receiver that will wait for a result from the
    container.
            <p/>
            The default value is 60 seconds.]]>
    </comment>
    </property>
    But this changes nothing...
    Is this value ignored?

  • WebService Consuming Message Error: ConnectException: Connection timed out:

    Hi experts,
    I'm using NWDS to consume an external WebSevice and after create an iView on EP6.
    First I created a Deployable WebService and deployed it on the server, so I created a Java Application to call this WS using the following code:
    <i>public class JQSRedirect extends HttpServlet {
         protected void doGet(
              HttpServletRequest request,
              HttpServletResponse response)
              throws ServletException, IOException {
              PrintWriter pw = response.getWriter();
              try{
                   String applicationID = "XXXX";
                   String passwordID = "XXXXX";
                   String userID = "XXXXXX";
                   String redirectURL = "http://XXXXXXX/preportal.aspx?token={";
                   String token = "";
                   InitialContext in = new InitialContext();
                   NJQSService nJQSService = (NJQSService)in.lookup("wsclients/proxies/sap.com/jqsWebService/ng.com.xxxx.jqsWebServiceProxy");
              NJQSServiceSoap njqsPort = nJQSService.getLogicalPort();
                   GetTokenN getTokenN = new GetTokenN();
    +token = njqsPort.getTokenN(userID, applicationID, passwordID);
                   pw.write("token: " + token);
              catch(Exception e) {
                   pw.write(e.toString());
                   e.printStackTrace();
         protected void doPost(
              HttpServletRequest request,
              HttpServletResponse response)
              throws ServletException, IOException {
              //TODO : Implement
    }</i>
    When I'm testing , the system display the follow message: <b>java.rmi.RemoteException: Service call exception; nested exception is: java.net.ConnectException: Connection timed out: connect</b>
    How to correct this error?
    Regards,
    Armando

    Hi,
    I found a reason for the previous error, I setted up the firewall rules and it works, but now we have another error message:
    java.rmi.RemoteException: Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (405) Method Not Allowed. The requested URL was:"http://193.122.30.8/XXXXXXXX/NJQS/njqsservice.wsdl"
    I made some researchs on the SDN and another sites of Internet that suggests a proxy configuration, but I don't have proxy on my server.
    Any Idea that can help me?
    Regards,
    Armando

  • Had to reload i tunes following hard drive reboot now cannot acess i tunes stor keep getting error message "unable to connect to the internet connection timed out " but I have no problem getting onto the internet

    Had to redownload i tunes following hard drive reboot but now cannot connect the i tunes store as I get the following error message " itunes could not connect to the itunes store the connection timed out " I get this message as soon as I click on the store.
    Any ideas how to solve this  ?????
    Bill

    Had to redownload i tunes following hard drive reboot but now cannot connect the i tunes store as I get the following error message " itunes could not connect to the itunes store the connection timed out " I get this message as soon as I click on the store.
    Any ideas how to solve this  ?????
    Bill

Maybe you are looking for

  • IMovie crashes when importing video from a camcorder

    Hello, I'm using iMovie, and I'm trying to import the video from my camcorder (sony HDR-PJ260VE). But when I clicked the camera button, iMovie crashes. iMovie does crash every time I try to press the import button. However, importing from video file

  • DVD Drive Broken on iSight G5

    Well, I think the DVD drive broek on my G5.  Also, I tok my new DVD drive and hooked it up, and it seems not to be compatible.  What can I do? Are there compatible drives - yes, I NEED to use the DVD drive for their school.  Thanks.

  • Running 5 commands using array elements and waiting between?

    Hi All, Trying to learn PS so please be patient with me ;) System: PSv3 on Win2012 server running WSUS role I am wanting to execute 5 commands using a 'foreach' loop but wait until one finishes before moving onto the next. Can you please check out wh

  • Problem with SELECT WHERE IN

    I'm having a problem with a SELECT clause... the variables... <cfset MyString=#getProducts.matches_with#> <cfset myArrayList = ListToArray(MyString)> the query... SELECT * FROM pricelist WHERE supplier_code IN ('#myArrayList[1]#' , '#myArrayList[2]#'

  • Templates in c++ vs interface in java

    What is the advantage of using interface in java than use of templates in C++