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... :-/

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.

  • 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!

  • 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.

  • 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.

  • [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.

  • 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: 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

  • 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

  • Connection timed out when making RMI call

    Hello,
    I am using a combination of Spring Remoting and Scheduling with Quartz Timer. Both are using RMI as a communication stack. The RMI server is located in sydney while the client is located in the US. This incurs large network lag which causes my RMI method calls to timeout. I am able to do a lookup on the RMI object and receive a stub reference to it with no problem but as soon as I try to invoke a remote method on that stub it eventually times out.
    Thinking it was truly a timeout issue I implemented a Custom socket factory for RMI using RMISocketFactory.setSocketFactory(new TimeoutSocketFactory(120000));Here is the custom TimeoutSocketFactory:
    public class TimeoutSocketFactory extends RMISocketFactory {
            private int timeout;
            private static final Logger log = Logger.getLogger(TimeoutSocketFactory.class);
            public TimeoutSocketFactory(int timeout) {
                this.timeout = timeout;
            public Socket createSocket(String host, int port) throws IOException {
                log.debug("Creating timeout socket with value - " + timeout);
                Socket ret = getDefaultSocketFactory().createSocket(host, port);
                ret.setSoTimeout(timeout);
                return ret;
            public ServerSocket createServerSocket(int port) throws IOException {
                ServerSocket ss = getDefaultSocketFactory().createServerSocket(port);
                ss.setSoTimeout(timeout);
                return ss;
    }I implemented the custom socket factory both on the RMI server and on the RMI client. This had no effect on the time outs that occured when trying to make an RMI call to the server even though the sockets were being built by this custom class (have logging in place).
    Is there something else I need to do to increase the timeout period? And how do I know if it's a server or a client issue?
    Thanks,
    Anthony Bargnesi
    [Exception StackTrace]
    java.rmi.ConnectException: Connection refused to host: 172.16.10.97; nested exception is:
         java.net.ConnectException: Connection timed out: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
         at org.springframework.remoting.rmi.RmiInvocationWrapper_Stub.invoke(Unknown Source)
         at com.aquent.rmi.test.RMIClient.connectService(RMIClient.java:46)
         at com.aquent.rmi.test.RMIClient.main(RMIClient.java:81)
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at java.net.Socket.<init>(Socket.java:365)
         at java.net.Socket.<init>(Socket.java:178)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at com.aquent.rmi.test.TimeoutFactory.createSocket(TimeoutFactory.java:21)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)

    Well this is a connect timeout, not a read timeout, so it has nothing to do with your socket factory, and your socket factory won't help. It's a connectivity issue. Can you ping that host from the client? Can you telnet to port 7?
    In fact no socket factory will help because there is no way of increasing the connect timeout beyond the default: you can only reduce it.

  • Connection refused to host: connection timed out

    I have been struggling with this problem a couple of days now so I really hope someone can help me. I am trying to get rmi to work in a NAT environment. We use a firewall, so I have opened port 1099 and 2020 which I use as a fixed port for communication (just to be sure it is not a firewall thing); I use the following code:
    //server
    public class ComputeEngine extends UnicastRemoteObject
    implements Compute
    public ComputeEngine() throws RemoteException {
    super();
    public String getMessage() {
    return "you have successfully connected to the server";
    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    String port = args[0];
    try {
    RMISocketFactory.setSocketFactory(new FixedPortRMISocketFactory(Integer.parseInt(port)));
    } catch (IOException e) {
    e.printStackTrace();
    LocateRegistry.createRegistry( 1099 );
    catch (RemoteException e1) {
    e1.printStackTrace();
    String name = "rmi://localhost/Compute";
    try {
    Compute engine = new ComputeEngine();
    Naming.rebind(name, engine);
    System.out.println("ComputeEngine bound");
    while(true); //stay alive
    } catch (Exception e) {
    System.err.println("ComputeEngine exception: " + e.getMessage());
    e.printStackTrace();
    public Socket createSocket(String host, int port)
    throws IOException {
    System.out.println("creating socket to host : " + host + " on port " + port);
    return new Socket(host, port);
    * Create a server socket on the specified port (port 0 indicates
    * an anonymous port) and writes out some debugging info
    * @param port the port number
    * @return the server socket on the specified port
    * @exception IOException if an I/O error occurs during server socket
    * creation
    * @since JDK1.1
    public ServerSocket createServerSocket(int port)
    throws IOException {
    port = (port == 0 ? portnumber : port);
    System.out.println("creating ServerSocket on port " + port);
    return new ServerSocket(port);
    //client
    public class ComputePi {
    public static void main(String args[]) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    String name = "rmi://" + args[0] + "/Compute";
    Compute comp = (Compute) Naming.lookup(name);
    System.out.println("connected to server");
    System.out.println(comp.getMessage());
    } catch (Exception e) {
    System.err.println("ComputePi exception: " + e.getMessage());
    e.printStackTrace();
    I start the client with:
    java -Djava.security.policy=policy.all -jar client.jar 194.2.4.6:1099
    I start the server with:
    java -Djava.rmi.server.codebase="file:/C:\RMI\\server.jar" -Djava.rmi.server.hostname="194.2.4.6" -Djava.security.policy=policy.all -jar server.jar 2020
    As you can see I set the "-Djava.rmi.server.hostname" property which should be a solution to the NAT problem. However I keep getting the following exception!!??!!:
    ComputePi exception: Connection refused to host: 194.2.4.6; nested exception is:
         java.net.ConnectException: Connection timed out: connect
    java.rmi.ConnectException: Connection refused to host: 194.2.4.6; nested exception is:
         java.net.ConnectException: Connection timed out: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
         at sun.rmi.server.UnicastRef.newCall(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at client.ComputePi.main(ComputePi.java:14)
    Caused by: 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.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 sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
         ... 7 more
    Can anyone help me with this, please??????
    kind regards,
    Christiaan

    Yes, i can ping it from the client.
    I have also noticed that when i run my server with the option -Djava.rmi.server.hostname=IP the applications stops automatically after a few minuts...
    I'm not using nothing about codebase. I have the stub and skel classes in server and client machines..
    I add the complete exception:
    Client exception: java.rmi.ConnectException: Connection refused to host: external_IP; nested exception is:
    java.net.ConnectException: Connection timed out: connect
    java.rmi.ConnectException: Connection refused to host: external_IP; nested exception is:
    java.net.ConnectException: Connection timed out: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
    at example.hello.Server_Stub.sayHello(Unknown Source)
    at example.hello.Client.main(Client.java:55)
    Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:426)
    at java.net.Socket.connect(Socket.java:376)
    at java.net.Socket.<init>(Socket.java:291)
    at java.net.Socket.<init>(Socket.java:119)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
    SocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
    SocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
    ... 5 more

  • 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

  • Getting error  connection timed out while invoking webservice from bpel.

    Hi,
    I am trying to call a secure webservice developed in .Net having extension .svc from the bpel service and in response i am getting error
    com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault}
    messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
    parts: {{summary=<summary>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</summary>
    I am able to call this web service from the java programme using HTTPClient by setting the username/password and soapaction in http Header but not from the BPEL process. This .Net service is synchronous in nature. I also set the proxy in opmn.xml but didn't got any success.
    Please reply me ASAP. Need urgent help.
    Thanks.

    Are you working on 11g ? if this is 11g
    How are you invoking the webservice ...does it have any authentication..
    If the webservice which you are invoking has basic http authentication...
    1. In the composite.xml file, right click on the reference and configure WS policies. In security tab, add a security policy named"oracle/wss_http_token_client_policy"
    2. Add two binding properties for the reference
    (i) oracle.webservices.auth.username
    (ii) oracle.webservices.auth.password
    and provide the username and password for those two properties...
    Just try this out...
    Thanks,
    N

Maybe you are looking for

  • Error while creating a Event in Table maintanence gen

    Hi, I've created a table maintanence gen every thing worked fine...i wanted to create a event 05 at new entries in my table main gen so i did it and wrote a subroutine inside it without any logic since i thougt of doing it later and just saved it and

  • Black and White Tv Pictures with Qosmio G10-106

    Grey hairs and going bald from pulling hair out. Bought Toshiba G10-106 in Jan 05,living in Ireland using ordinary Tv cable for laptop and cannot get Tv to work properly.B&w images are the best ive got so far. Is there compatability issues with Toshi

  • Java.lang.NullPointerException returned from webservice

    Hi I have an axis client which sends an image attachment to an axis webservice, however I am returned with a null pointer exception, this is my client, package chapter5; import java.net.URL; import org.apache.axis.client.Service; import org.apache.ax

  • Set Ip address

    Hi everyone, i´m doing a DHCP service, but i have a problem, i can´t set the new IP address that the server give to client, i have treat with different classes, but the only thing that i can do is get de Ip address, but i need to set it in the client

  • Info record price history

    Dear Experts, If we go to inforecord> Environment>Order price history, we can find a order price history report. The Table in which this price history data is stored is EIPA. I there any transaction to upload past order price history in SAP while ini