Archived

This forum has been archived. Please start a new discussion on GitHub.

IceGrid GUI fails to connect to the registry

Hello,

We use the IceGrid GUI under Linux quite a lot and it works without any problems -- once you find the right Java version.

Now we have a new kind of problem: the GUI fails to connect to the registry.
$ java -jar ./IceGridGUI.jar --Ice.Trace.Network=2
-- 4/08/10 19:15:50:251 IceGrid Admin: Network: trying to establish tcp connection to 127.0.0.1:12000
-- 4/08/10 19:15:50:260 IceGrid Admin: Network: failed to establish tcp connection to 127.0.0.1:12000
Ice.SocketException
error = 0

Tried on 4 computers with IceGridGUI.jar versions 3.3.0, 3.3.1, 3.4.0.
Using icegridregistry version 3.4.0 and 3.4.1 with various configurations, from our standard production configs to the simplest possible.
In all cases icegridadmin works without any problems.
$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)

It still does work on one laptop which is configured exactly the same as the others as far as I can tell except the java version on it is 1.6.0_12. That shouldn't be a problem, am I correct? Copied this version of Java to the other places -- no change.

Any clues to what to try next?

Thanks,
Alex

The output of icegridadmin on the same machine as above is here:
$ icegridadmin --Ice.Trace.Network=2 --Ice.Default.Locator='IceGrid/Locator:default -h localhost -p 12000'
-- 08/04/10 19:40:19.461 Network: trying to establish tcp connection to 127.0.0.1:12000
-- 08/04/10 19:40:19.462 Network: tcp connection established
local address = 127.0.0.1:35311
remote address = 127.0.0.1:12000
-- 08/04/10 19:40:19.463 Network: created adapter `CollocInternal' without endpoints
-- 08/04/10 19:40:19.463 Network: published endpoints for object adapter `CollocInternal':

Comments

  • bernard
    bernard Jupiter, FL
    Hi Alex,

    You should use the IceGridGUI 3.4.x with the IceGrid registry 3.4, not a previous version.

    On which operating system do you get this error?

    Thanks,
    Bernard
  • Hi Bernard,

    We use Debian Linux (Testing).

    I mentioned Java version in my previous email (1.6.0_20)

    On the machines where we cannot get it to work we've tried all versions of IceGrid GUI (from 3.3.0 to 3.4.0). Just as side note, on the machine where it does work, IceGrid GUI 3.3.0 seems to work fine with Registry 3.4.0.

    To clarify, does icegridadmin now use the same mechanism/interface as IceGrid GUI? I remember at some point they did not.

    Thanks for looking into it,
    Alex
  • benoit
    benoit Rennes, France
    Hi Alex,

    Yes the GUI and the command line tool are using the same APIs to connect to the registry. Do you have a complete stack trace of the Ice.SocketException?

    Cheers,
    Benoit.
  • Hi Benoit,

    Can you tell me how to obtain the stack trace?

    Part of the problem is that I have no idea how to even begin to debug a Java app. I enabled the standard Ice traces but they don't add much.
    $ java -jar ./IceGridGUI.jar --Ice.Trace.Network=2
    -- 4/08/10 19:15:50:251 IceGrid Admin: Network: trying to establish tcp connection to 127.0.0.1:12000
    -- 4/08/10 19:15:50:260 IceGrid Admin: Network: failed to establish tcp connection to 127.0.0.1:12000
    Ice.SocketException
    error = 0

    Thanks,
    Alex
  • benoit
    benoit Rennes, France
    Hi Alex,

    Yes, sorry the stack trace isn't printed in the traces. One way to obtain a stack trace would be to connect to the IceGrid port with another Ice client such as the Ice client from the hello demo (modify the port from 10000 to 12000 in config.client to point to the registry). The hello client should print the stack trace of the exception.

    Cheers,
    benoit.
  • Ok, I can try that.

    One question first: isn't it exactly what icegridadmin is doing? As icegridadmin doesn't have any problem connecting, shouldn't the same happen to the hello example?

    Or should I use the Java example? Does it exist?

    Alex
  • benoit
    benoit Rennes, France
    Hi Alex,

    Yes, icegridadmin does the same thing as the Java IceGridGUI to connect to the registry. I don't see why it would work with the icegridadmin CLI but not with the GUI so seeing the stack trace might give us some clues. You can also use the IceGrid Java demo to try it out.

    Cheers,
    Benoit.
  • Hi Benoit,
    we are still trying to debug this.

    We started with another Linux laptop with Ice-3.4.1 on it.

    Using standard Debian Testing java
    $ java -version
    java version "1.6.0_18"
    OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-1)
    OpenJDK Server VM (build 14.0-b16, mixed mode)
    

    Running a pre-compiled java archive from the 3.4.1 Solaris distribution.

    Is this combination supposed to work? Or do we need to compile the IceGridGUI.jar from source?

    Cheers,
    Alex


    (icegridadmin works perfectly as before. Also used our own C++ code to ice_ping the Locator interface.)
    $ java -jar ./IceGridGUI.jar --Ice.Trace.Network=2 --Ice.Trace.Protocol=2
    -- 3/09/10 14:14:00:880 IceGrid Admin: Network: trying to establish tcp connection to 127.0.0.1:12000
    -- 3/09/10 14:14:00:887 IceGrid Admin: Network: failed to establish tcp connection to 127.0.0.1:12000
       Ice.SocketException
           error = 0
    
  • Another bit of info...
    we tested it with the Sun Java (in the past we had some problems with the standard Debian Java distribution which were resolved by switching to the Sun version).

    unfortunately, it didn't help with this problem. same result with Ice.SocketException.

    java versions are below.

    SUN version
    $ java -version
    java version "1.6.0_21"
    Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
    Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)
    

    OpenJDK version
    $ java -version
    java version "1.6.0_18"
    OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-1)
    OpenJDK Server VM (build 14.0-b16, mixed mode)
    
  • benoit
    benoit Rennes, France
    Did you try to see if it also failed for other Java clients (using the Java demos for example)? If it fails, do you have a more detailed stack trace?

    Cheers,
    Benoit.
  • Ok, we got the Java traces after a failed connection. I hope it will shed some light.

    I'm not a 100% sure that we compiled the Java source properly since this was the first time we've done it. At the end it seemed to compile ok. Most of the java tests run fine (it got stuck towards the end on some Freeze test).

    We used the following Sun version:
    java version "1.6.0_21"
    Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
    Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)

    When we try to run one of the simple Java demos:

    SERVER
    =======
    xxx@xxx:~/downloads/Ice-3.4.1/java/demo/Ice/minimal$ java Server --Ice.Trace.Network=3
    -- 11/09/10 14:43:44:583 Network: attempting to bind to tcp socket 0.0.0.0:10000
    -- 11/09/10 14:43:44:585 Network: accepting tcp connections at 0:0:0:0:0:0:0:0:10000 local interfaces: 192.168.0.15, 127.0.0.1
    -- 11/09/10 14:43:44:587 Network: published endpoints for object adapter `Hello': tcp -h 192.168.0.15 -p 10000

    CLIENT
    ======
    xxx@xxx:~/downloads/Ice-3.4.1/java/demo/Ice/minimal$ java Client --
    Ice.Trace.Network=3
    -- 11/09/10 14:46:02:045 Network: trying to establish tcp connection to 127.0.0.1:10000
    -- 11/09/10 14:46:02:053 Network: failed to establish tcp connection to 127.0.0.1:10000 Ice.SocketException
    error = 0
    -- 11/09/10 14:46:02:054 Network: trying to establish tcp connection to 127.0.0.1:10000
    -- 11/09/10 14:46:02:055 Network: failed to establish tcp connection to 127.0.0.1:10000
    Ice.SocketException
    error = 0
    Ice.SocketException
    error = 0
    at IceInternal.ConnectRequestHandler.initialized(ConnectRequestHandler.java:366)
    at IceInternal.ConnectRequestHandler.connect(ConnectRequestHandler.java:45)
    at Ice._ObjectDelM.setup(_ObjectDelM.java:275)
    at Ice.ObjectPrxHelperBase.createDelegate(ObjectPrxHelperBase.java:2145)
    at Ice.ObjectPrxHelperBase.__getDelegate(ObjectPrxHelperBase.java:2061)
    at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:110)
    at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:77)
    at Demo.HelloPrxHelper.checkedCast(HelloPrxHelper.java:132)
    at Client.main(Client.java:20)
    Caused by: java.net.SocketException: Network is unreachable
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
    at IceInternal.Network.doConnect(Network.java:292)
    at IceInternal.TcpConnector.connect(TcpConnector.java:28)
    at IceInternal.OutgoingConnectionFactory$ConnectCallback.nextConnector(OutgoingConnectionFactory.java:1173)
    at IceInternal.OutgoingConnectionFactory.getConnection(OutgoingConnectionFactory.java:656)
    at IceInternal.OutgoingConnectionFactory.access$700(OutgoingConnectionFactory.java:12)
    at IceInternal.OutgoingConnectionFactory$ConnectCallback.getConnection(OutgoingConnectionFactory.java:1143)
    at IceInternal.OutgoingConnectionFactory$ConnectCallback.connectors(OutgoingConnectionFactory.java:1028)
    at IceInternal.EndpointHostResolver.run(EndpointHostResolver.java:106)
    at IceInternal.EndpointHostResolver$HelperThread.run(EndpointHostResolver.java:152)


    The equivalent demo for C++ runs fine and I can't see a difference in the
    output (ie the same port is used):

    SERVER
    ======
    xxx@xxx:~/downloads/Ice-3.4.1/cpp/demo/Ice/minimal$ ./server --
    Ice.Trace.Network=3
    -- 09/11/10 14:49:00.459 Network: attempting to bind to tcp socket 0.0.0.0:10000
    -- 09/11/10 14:49:00.459 Network: accepting tcp connections at 0.0.0.0:10000 local interfaces: 192.168.0.15, 127.0.0.1
    -- 09/11/10 14:49:00.464 Network: published endpoints for object adapter `Hello': tcp -h 192.168.0.15 -p 10000


    CLIENT
    ======
    xxx@xxx:~/downloads/Ice-3.4.1/cpp/demo/Ice/minimal$ ./client --
    Ice.Trace.Network=3
    -- 09/11/10 14:49:24.204 Network: trying to establish tcp connection to
    127.0.0.1:10000
    -- 09/11/10 14:49:24.206 Network: tcp connection established
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.206 Network: received 14 of 14 bytes via tcp
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.211 Network: sent 56 of 56 bytes via tcp
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.211 Network: received 14 of 14 bytes via tcp
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.211 Network: received 12 of 12 bytes via tcp
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.213 Network: sent 43 of 43 bytes via tcp
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.214 Network: received 14 of 14 bytes via tcp
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.214 Network: received 11 of 11 bytes via tcp
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.238 Network: sent 14 of 14 bytes via tcp
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000
    -- 09/11/10 14:49:24.240 Network: closing tcp connection
    local address = 127.0.0.1:33552
    remote address = 127.0.0.1:10000

    SERVER response:
    ================
    -- 09/11/10 14:49:24.205 Network: accepted tcp connection
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    -- 09/11/10 14:49:24.205 Network: sent 14 of 14 bytes via tcp
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    -- 09/11/10 14:49:24.207 Network: received 14 of 14 bytes via tcp
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    -- 09/11/10 14:49:24.207 Network: received 42 of 42 bytes via tcp
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    -- 09/11/10 14:49:24.207 Network: sent 26 of 26 bytes via tcp
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    -- 09/11/10 14:49:24.212 Network: received 14 of 14 bytes via tcp
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    -- 09/11/10 14:49:24.212 Network: received 29 of 29 bytes via tcp
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    Hello World!
    -- 09/11/10 14:49:24.212 Network: sent 25 of 25 bytes via tcp
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    -- 09/11/10 14:49:24.233 Network: received 14 of 14 bytes via tcp
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
    -- 09/11/10 14:49:24.238 Network: closing tcp connection
    local address = 127.0.0.1:10000
    remote address = 127.0.0.1:33552
  • benoit
    benoit Rennes, France
    Hi Alex,

    Can you try to run java with -Djava.net.preferIPv4Stack=true and see if it helps?
    $ java -Djava.net.preferIPv4Stack=true Server --Ice.Trace.Network=2
    $ java -Djava.net.preferIPv4Stack=true Client --Ice.Trace.Network=2
    

    Cheers
    Benoit.
  • Thanks Benoit,
    the config flag solved it!

    Both the examples (built from source) and the IceGrid GUI (from the Solaris distribution) work.

    Cheers,
    Alex