Archived

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

Problem with Ice-3.1.1

Hi,

I am new to Ice and I have a problem.
I have downloaded Ice-3.1.1 and .NET Framework 2.0.Then I tried /Ice-3.1.1/democs/Ice/minimal example, I started the server then the client and firstly the client fails(ConnectionLostException, Ice(InternalProxy.Factory.CheckRetryAfterException..).When the server was still running and I started client for the second time, it was OK and hello world message appeared on the server side. And after some time I made the same experiment with the same results(sometimes OK sometimes exeptions).I remind port 10000 is free on my computer.
I also tried to disable firewall, but without effect.
--
I also participate on a project(which was tried on several computers) which needs Ice-3.1.1 and when I started the application, ConnectionLostException or NoEndPointException appear.Here is an interesting part of Visual C# output window:

icegridnode: error: service caught unhandled Ice exception:
.\Network.cpp:475: Ice::SocketException:
socket exception: WSAEADDRINUSE
IceGrid started

Do you know where would be the problem ??

Thanks

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Could you please provide more information such as the full error messages, stack traces from the exceptions, configuration files, OS version?

    An Ice.ConnectionLostException exception indicates that the server closed the connection.

    And the message:
    Network.cpp:475: Ice::SocketException:
    socket exception: WSAEADDRINUSE

    indicates that one of the object adapters of the IceGrid node couldn't listen of a specific port because it's already in use. I suspect it's the port of the IceGrid registry client endpoints. Are you sure that no other IceGrid registry is already running?

    Cheers,
    Benoit.
  • Re

    Ok, my mistake, so here is much more informations:

    complet error message on client side in minimal demo:

    Ice.ConnectionException: ConnectionLostException
    error=0
    at IceInternal.ProxyFactory.checkRetryAfterException(LocalException ex, Reference ref, Int32 cnt)
    at Ice.ObjectPrxHelperBase.handleException__(LocalException ex, Int32 cnt)
    at Ice.ObjectPrxHelperBase.ice_isA(String id__, Context context__)
    at Ice.ObjectPrxHelperBase.ice_isA(String id__)
    at Demo.HelloPrxHelper.checkedCast(ObjectPrx b)
    at Client.Main(String[] args)
    Caused by: System.Net.Sockets.SocketException: connection was terminated by remote host
    at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
    at IceInternal.TcpTransceiver.write(BasicStream stream, Int32 timeout)

    output window(not all) in application tat uses Ice:


    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'FerdaFrontEnd.exe' (Managed): Loaded 'G:\Ferda\bin\FrontEnd\FerdaFrontEnd.exe', Symbols loaded.
    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'FerdaFrontEnd.exe' (Managed): Loaded 'G:\Ferda\bin\FrontEnd\FrontEndAddInHelper.dll', Symbols loaded.
    'FerdaFrontEnd.exe' (Managed): Loaded 'G:\Ferda\bin\FrontEnd\FerdaProjectManager.dll', Symbols loaded.
    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\FerdaBase\0.0.0.0__cbe18eed93b6dbb1\FerdaBase.dll', No symbols loaded.
    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\icecs\3.1.1.0__1f998c50fec78381\icecs.dll', No symbols loaded.
    'FerdaFrontEnd.exe' (Managed): Loaded 'G:\Ferda\bin\FrontEnd\FerdaModulesManager.dll', Symbols loaded.
    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'FerdaFrontEnd.exe' (Managed): Loaded 'zluf9mts', No symbols loaded.
    'FerdaFrontEnd.exe' (Managed): Loaded 'G:\Ferda\bin\FrontEnd\NetronGraphLib.dll', Symbols loaded.
    'FerdaFrontEnd.exe' (Managed): Loaded 'G:\Ferda\bin\FrontEnd\DockDotNET.dll', Symbols loaded.
    icegridnode: warning: administrative endpoints `IceGrid.Registry.Admin.Endpoints' enabled
    icegridnode: warning: couldn't contact the IceGrid registry:
    .\TcpTransceiver.cpp:285: Ice::ConnectionLostException:
    connection lost: WSAECONNRESET
    IceGrid started
    Loading config and creating communicator...
    [ icegridnode: Server: changed server `0' state to `Loading' ]
    [ icegridnode: Server: changed server `0' state to `Inactive' ]
    icegridnode: warning: failed to deploy application `application.xml':
    .\TcpTransceiver.cpp:285: Ice::ConnectionLostException:
    connection lost: WSAECONNRESET
    Creating factory for basic property types...
    Adding that factory to communicator...
    Creating adapter...
    Activating adapter...
    Creating helper of modules manager...
    Creating BoxModuleIceFactories...
    Creating ManagersEngine...
    Creating Output...
    Creating BoxModuleLocker...
    Creating BoxModuleValidator...
    Creating BoxModuleProjectInformation...
    Creating ManagersLocator...
    'FerdaFrontEnd.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\icegridcs\3.1.1.0__1f998c50fec78381\icegridcs.dll', No symbols loaded.
    Starting Refresh in ManagersLocatorI...
    Getting communicator...
    Getting QueryPrx...
    Getting BoxModuleFactoryCreators...
    [ icegridnode: Server: changed server `0' state to `Activating' ]
    [ icegridnode: Activator: activating server `0'
    path = C:\Ice-3.1.1\bin\iceboxnet.exe
    pwd = G:\Ferda\bin\Server
    args = C:\Ice-3.1.1\bin\iceboxnet.exe --Ice.Config=G:\Ferda\bin\db/node/servers/0/config/config ]
    [ icegridnode: Server: changed server `0' state to `WaitForActivation' ]
    Adding BoxModuleFactoryCreators...
    Checked cast...
    [ icegridnode: Adapter: server `0' adapter `0.FerdaDataPreparationBoxes.FerdaDataPreparationBoxes' activated: dummy -t:tcp -h 127.0.0.1 -p 4665:udp -h 127.0.0.1 -p 4666 ]
    A first chance exception of type 'Ice.ConnectionLostException' occurred in icecs.dll
    [ icegridnode: Adapter: server `0' adapter `0.FerdaBasicBoxes.FerdaBasicBoxes' activated: dummy -t:tcp -h 127.0.0.1 -p 4677:udp -h 127.0.0.1 -p 4678 ]
    [ icegridnode: Adapter: server `0' adapter `0.FerdaSampleBoxes.FerdaSampleBoxes' activated: dummy -t:tcp -h 127.0.0.1 -p 4680:udp -h 127.0.0.1 -p 4681 ]
    [ icegridnode: Adapter: server `0' adapter `0.FerdaGuhaMiningBoxes.FerdaGuhaMiningBoxes' activated: dummy -t:tcp -h 127.0.0.1 -p 4683:udp -h 127.0.0.1 -p 4684 ]
    [ icegridnode: Adapter: server `0' adapter `0.FerdaGuhaMiningProcessor.FerdaGuhaMiningProcessor' activated: dummy -t:tcp -h 127.0.0.1 -p 4688:udp -h 127.0.0.1 -p 4689 ]
    [ icegridnode: Server: changed server `0' state to `Active' ]
    [ icegridnode: Adapter: server `0' adapter `0.FerdaWizards.FerdaWizards' activated: dummy -t:tcp -h 127.0.0.1 -p 4691:udp -h 127.0.0.1 -p 4692 ]
    icegridnode: error: a node with the same name is already registered and active
    A first chance exception of type 'Ice.NoEndpointException' occurred in icecs.dll
    Checked cast was OK
    Adding that creator DataPreparation.Categorization.EachValueOneCategory
    Checked cast...
    Checked cast was OK
    Adding that creator DataPreparation.Categorization.EquidistantIntervals
    Checked cast...
    A first chance exception of type 'Ice.ObjectNotExistException' occurred in icecs.dll
    A first chance exception of type 'Ice.ObjectNotExistException' occurred in icecs.dll

    The exception was: LocatorNotFoundException


    Thanks for advices
    kippo
  • benoit
    benoit Rennes, France
    Hi,

    You need to figure out why you're getting these Ice::ConnectionLostException exceptions. As mentioned in my previous post, this exception indicates that the peer forcefully closed the connection for some reasons (e.g.: the server was killed or terminated, the network connection was dropped, etc).

    Is everything running on the same machine? Does the Ice test suite and demos run fine on your machine?

    Cheers,
    Benoit.
  • Re

    Hi,

    yes, everything is running on the SAME machine. I tried only one Ice demo example -> /democs/minimal. In my first supply I discribed the behavior.Sometimes it runs fine, sometimes ConnectionLostException etc.

    Is some way, how to identify whether some process is killing server or connection was dropped etc. ???


    here is Visual C# output from \democs\demo.sln (interesting is only the end)

    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'client.vshost.exe' (Managed): Loaded 'C:\Ice-3.1.1\democs\Ice\callback\client.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\icecs\3.1.1.0__1f998c50fec78381\icecs.dll', No symbols loaded.
    The thread 0xc8 has exited with code 0 (0x0).
    'client.vshost.exe' (Managed): Loaded 'C:\Ice-3.1.1\democs\Ice\callback\client.exe', Symbols loaded.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\icesslcs\3.1.1.0__1f998c50fec78381\icesslcs.dll', Symbols loaded.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'client.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    A first chance exception of type 'Ice.DNSException' occurred in icecs.dll
    A first chance exception of type 'Ice.DNSException' occurred in icecs.dll
    A first chance exception of type 'Ice.ConnectionRefusedException' occurred in icecs.dll

    here is stack trace of demo.sln

    [External Code]
    icesslcs.dll!IceSSL.ConnectorI.connect(int timeout = -1) Line 43 + 0x14 bytes
    [External Code]
    > client.exe!Demo.CallbackSenderPrxHelper.checkedCast(Ice.ObjectPrx b = {callback -t:tcp -h 84.42.189.233 -p 10000:udp -h 84.42.189.233 -p 10000:ssl -h 84.42.189.233 -p 10001}) Line 323 + 0xe bytes
    client.exe!Client.run(string[] args = {Dimensions:[0]}) Line 53 + 0x3f bytes
    [External Code]
    client.exe!Client.Main(string[] args = {Dimensions:[0]}) Line 183 + 0x13 bytes
    [External Code]

    It was ConnectionRefusedException on line 323 Callback.cs

    Thanks for advices
  • benoit
    benoit Rennes, France
    Hi,

    Sorry, I don't know why you're getting these Ice::ConnectionLostException exceptions, it looks like you have some networking problems on your machine. Does your machine have multiple network interfaces?

    You should try to run the demo/Ice/hello client and server in a Windows command shell (to avoid all the extra debugging output from the Visual Studio debugger) with --Ice.Trace.Network=2. You should see the IP address used by the client to connect to your server, if you have multiple network interfaces you might be able to see which interface is causing network troubles.

    You can also try to modify config.server and config.client from demo/Ice/hello and add a "-h localhost" option to the endpoints of the server object adapter and hello proxy:
    config.server:
    ---------------
    Ice.OA.Hello.Endpoints=tcp -p 10000 -h 127.0.0.1
    
    config.client:
    -------------
    Hello.Proxy=hello:tcp -p 10000 -h 127.0.0.1
    

    With this option, the client and server will use the loopback interface to communicate.

    Cheers,
    Benoit.
  • Re

    Hi,

    I tried you first offer. Here is the report from console.

    server --Ice.Trace.Network=2

    server side before running client:
    [ server.exe: Network: attempting to bind to tcp socket 84.42.189.233:10000 ]
    [ server.exe: Network: accepting to tcp connections at 84.42.189.233:10000 ]
    [ server.exe: Network: attempting to bind to tcp socket 127.0.0.1:10000 ]
    [ server.exe: Network: accepting to tcp connections at 127.0.0.1:10000 ]

    after running client
    [ server.exe: Network: accepted tcp connection local address = 84.42.189.233:10000 remote address = 84.42.189.233:1158 ]
    [ server.exe: Network: shutting down tcp connection for writing = 84.42.189.233:10000 remote address = 84.42.189.233:1158 ]
    [ server.exe: Network: closing tcp connection = 84.42.189.233:10000 remote address = 84.42.189.233:1158 ]
    [ server.exe: Network: accepted tcp connection local address = 84.42.189.233:10000 remote address = 84.42.189.233:1161 ]
    [ server.exe: Network: closing tcp connection = 84.42.189.233:10000 remote address = 84.42.189.233:1161 ]
    [ server.exe: Network: accepted tcp connection local address = 84.42.189.233:10000 remote address = 84.42.189.233:1174 ]
    [ server.exe: Network: shutting down tcp connection for writing = 84.42.189.233:10000 remote address = 84.42.189.233:1174 ]
    [ server.exe: Network: closing tcp connection = 84.42.189.233:10000 remote address = 84.42.189.233:1174 ]
    [ server.exe: Network: accepted tcp connection local address = 84.42.189.233:10000 remote address = 84.42.189.233:1177 ]
    [ server.exe: Network: shutting down tcp connection for writing = 84.42.189.233:10000 remote address = 84.42.189.233:1177 ]
    [ server.exe: Network: closing tcp connection = 84.42.189.233:10000 remote address = 84.42.189.233:1177 ]



    client --Ice.Trace.Network=2

    client side:
    [ client.exe: Network: trying to establish tcp connection to 84.42.189.233:10000 ]
    [ client.exe: Network: tcp connection established local address = 84.42.189.233:1174 remote address = 84.42.189.233:10000 ]
    [ client.exe: Network: closing tcp connection local address = 84.42.189.233:1174 remote address = 84.42.189.233:10000 ]
    [ client.exe: Network: trying to establish tcp connection to 84.42.189.233:10000 ]
    [ client.exe: Network: tcp connection established local address = 84.42.189.233:1177 remote address = 84.42.189.233:10000 ]
    [ client.exe: Network: shutting down tcp connection for writing = 84.42.189.233:1177 remote address = 84.42.189.233:10000 ]
    [ client.exe: Network: closing tcp connection local address = 84.42.189.233:1177 remote address = 84.42.189.233:10000 ]
    Ice.ConnectionLostException: ConnectionLostException
    ...

    We found the reason, but what is the solution ??

    Why there are various port numbers on client side ??

    Why is server started with 84.42.189.233 and also with 127.0.0.1 ??

    Thank you very much

    kippo
  • benoit
    benoit Rennes, France
    Hi,

    See this FAQ for more information on the port numbers. Ice listens on all the network interfaces available on your machine if you don't specify a "-h" option in the object adapter endpoints, that's why it listens on 84.42.189.233 and 127.0.0.1. See the Ice manual for more information.

    It looks like something is wrong with the network setup on your machine, you shouldn't be getting these exceptions. You could try my second suggestion (use only the loopback interface) to see if the problem also exists for the loopback interface. You could also try on another machine to see if it works or not and to try to find out what could be wrong with your network setup.

    Cheers,
    Benoit.
  • Re

    Hi,

    according your suggestion I used loopback interface, but problem is still :(

    The failure must be on my machine.

    Have you got an idea how to solve my problem (such as some setting in Win XP etc.) ??


    Thanks
  • benoit
    benoit Rennes, France
    Sorry, I don't really have any good suggestions other than making sure to have the latest Windows XP service pack installed and to disable completely any firewall software installed on the machine. I guess if this still doesn't work you should try to re-configure the network interfaces and compare the settings with another machine where it works.

    Cheers,
    Benoit.