Unable to resolve Connection Timeout

2010-03-31
2012-11-29
  • Chad Sturtz
    Chad Sturtz
    2010-03-31

    I'm unable to connect to a remote host with JInterop… i'm getting a connection timeout (see stack trace below)

    All ports between the two machines are open.  We can ping the target host successfully.  We're getting the same on several machines (windows server 2003, 2008).  Also, we've tried the wbemtest.exe tool that comes on windows and we can successfully connect to the target hosts with that.

    Any ideas why we can connect with wbemtest.exe but not with JInterop?

    JInterop version 2.02

    org.jinterop.dcom.common.JIException: An internal error occurred.
                    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:871)
                    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:825)
                    at org.jinterop.dcom.core.JIComServer.addRef_ReleaseRef(JIComServer.java:904)
                    at org.jinterop.dcom.core.JISession.releaseRef(JISession.java:644)
                    at org.jinterop.dcom.core.JIComServer.createInstance(JIComServer.java:746)
                                   …
    Caused by: java.net.ConnectException: Connection timed out: connect
                    at sun.nio.ch.Net.connect(Native Method)
                    at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
                    at java.nio.channels.SocketChannel.open(Unknown Source)
                    at org.jinterop.dcom.transport.JIComTransport.attach(JIComTransport.java:98)
                    at rpc.Stub.attach(Stub.java:105)
                    at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:855)
                    … 12 more

     
  • Hi,
         Can you post your code ?

    thanks,
    best regards,
    Vikram

     
  • Btw, please use the latest version of the library.

    best regards,
    Vikram

     
  • i have the same error,and i use the version 2.08.
    below is my code

    JISystem.setAutoRegisteration(true);
    JISession session = JISession.createSession("localhost","admin","password");
    JIComServer comServer = new JIComServer(JIProgId.valueOf("Excel.Application"),"127.0.0.1",session);

    //Instantiate the COM Server
    IJIComObject excelObject = comServer.createInstance();
    …..
    …..
    …..

    the exception occurs when creating com server in the last line of code above.

    please help me, what can i do.
    thanks in advance.