Archived

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

IceGrid - Opening an admin session Ice 3.4

Hi,
I'm working on a distributed simulator and I plan to use IceGrid for the simulators to communicate.

I have a question before to go deeper. Is it necessary to have a deployment file to configure the Registry or each server can register itself ? (I think the second assumption is the right one, but I prefer to ask ;-)

Because i tryied the following piece of code to open an admin session and it fails when trying to cast the proxy.
(I think it's strange because the proxy ice_id returns "::IceGrid::Registry" which seems to be good.)

{
int argc =1 ;
char* argv[1]={{"Simulator"}};
Ice::CommunicatorPtr communicator = Ice::initialize(argc, argv);

Ice::ObjectPrx proxy = communicator->stringToProxy("SimulatorGrid/Registry -t:tcp -h 192.168.0.3 -p 4061");
IceGrid::RegistryPrx registry = IceGrid::RegistryPrx::checkedCast(proxy);
IceGrid::AdminSessionPrx session = registry->createAdminSession("Simulator", "simulatoradmin");
IceGrid::AdminPrx admin = session->getAdmin();
}

I just have a configuration file for the registry :

IceGrid.InstanceName=SimulatorGrid
IceGrid.Registry.Client.Endpoints=tcp -p 4061 -h 192.168.0.3
IceGrid.Registry.Server.Endpoints=tcp
IceGrid.Registry.Internal.Endpoints=tcp
IceGrid.Registry.PermissionsVerifier=O3SGrid/NullPermissionsVerifier
IceGrid.Registry.AdminPermissionsVerifier=O3SGrid/NullPermissionsVerifier
IceGrid.Registry.Data=./registryData
IceGrid.Registry.DynamicRegistration=1
IceGrid.Registry.Trace.Adapter=1
IceGrid.Registry.Trace.Locator=2
IceGrid.Registry.Trace.Object=1
IceGrid.Registry.Trace.Session=2

PS : When I check with the IceGridGui, the SimulatorGrid/Registry appears in the well kwown object panel with the locator used by the server.

Cheers

Comments

  • mes
    mes California
    Hi Laurent,

    Welcome to the forum!
    Laurent wrote: »
    I have a question before to go deeper. Is it necessary to have a deployment file to configure the Registry or each server can register itself ? (I think the second assumption is the right one, but I prefer to ask ;-)
    You are correct, it is not necessary to use a deployment file. Servers can register themselves dynamically, as long as you have set the IceGrid.Registry.DynamicRegistration property.
    Because i tryied the following piece of code to open an admin session and it fails when trying to cast the proxy.
    (I think it's strange because the proxy ice_id returns "::IceGrid::Registry" which seems to be good.)
    What do you mean when you say that it fails? Does the checkedCast return a nil proxy? Or are you getting an exception? If you're getting an exception, which one?

    Regards,
    Mark
  • Hi Mark,

    A nil pointer.

    Thank for your help,
    Laurent
  • mes
    mes California
    Hi,

    I can't reproduce this problem using your code example and configuration settings on SLES 11 with Ice 3.4. If you're still having trouble, please post an archive containing a small (but complete) test case, including any configuration files being used by the client and registry. Please also tell us which platform and compiler you are using.

    Regards,
    Mark
  • Hi,

    I'm running Windows 7 Pro on 2 different i7 PC computers and building the client through visual studio 8 pro.
    I have the same problem on both (Sony and Acer), using loopback or ETH board IP with or without firewall active.

    Best Regards,
    Laurent

    The zip file contains the cpp file and icegridrestry configuration file.
    (For the client, the registry IP and port are hardcoded)
  • mes
    mes California
    Hi,

    Are you really using Visual Studio 8, or was that a typing mistake? Please note that Visual Studio 8 is not a supported compiler for Ice 3.4. Furthermore, attempting to link a program compiled with Visual Studio 8 against the Ice 3.4 libraries from our binary distribution (which are compiled with VS9) can cause issues such as the one you are experiencing.

    Regards,
    Mark
  • bernard
    bernard Jupiter, FL
    Hi Laurent,

    Once you've resolved this first issue, I'd recommend using Ice.Default.Locator in your client. And then you get hold of the registry proxy with:
       communicator->stringToProxy("SimulatorGrid/Registry");
    

    All the best,
    Bernard
  • Hi Mark,
    I was talking about the product name. The compiler is vc9.
    Is that correct ? Do I have to compile Ice 3.4 by myself or migrate to Visual Studio 2010 ?
    I omitted to say that i'm running Windows 7 64 bits but I'm building using
    the 32 bits version of Ice 3.4. Is it compatible ?

    Thanks again for your answer.
    Best Regards,
    Laurent
  • Hi Bernard,
    Thanks for you advise. I will do it.
    Best Regards,
    Laurent
    bernard wrote: »
    Hi Laurent,

    Once you've resolved this first issue, I'd recommend using Ice.Default.Locator in your client. And then you get hold of the registry proxy with:
       communicator->stringToProxy("SimulatorGrid/Registry");
    

    All the best,
    Bernard
  • mes
    mes California
    Hi,
    Laurent wrote: »
    I was talking about the product name. The compiler is vc9.
    Is that correct ? Do I have to compile Ice 3.4 by myself or migrate to Visual Studio 2010 ?
    I omitted to say that i'm running Windows 7 64 bits but I'm building using
    the 32 bits version of Ice 3.4. Is it compatible ?
    Visual Studio 2008 (aka VC9) Service Pack 1 is the compiler that we support for Ice 3.4. You can use either 32-bit or 64-bit builds, you just have to make sure that you link against the proper libraries and have the correct DLLs in your PATH.

    I'm afraid I can't reproduce the problem you're describing. I compiled your example using VC9SP1 on Windows 7 x64 with the Ice build system (Makefiles) and everything worked correctly. If you're still having trouble, I recommend comparing your compiler options with those of the projects included in the Ice demo archive (see demos.zip in your Ice installation directory).

    Regards,
    Mark
  • Hi Mark,
    After some other successful tries on OSX, I check again the CPPFlags in details and i found that the program was linking with some release libraries while i was in debug.
    After correcting it, all was working well.

    I'm very sorry for the time you spend,
    Thanks a lot for your help,
    Laurent
    mes wrote: »
    Hi,


    Visual Studio 2008 (aka VC9) Service Pack 1 is the compiler that we support for Ice 3.4. You can use either 32-bit or 64-bit builds, you just have to make sure that you link against the proper libraries and have the correct DLLs in your PATH.

    I'm afraid I can't reproduce the problem you're describing. I compiled your example using VC9SP1 on Windows 7 x64 with the Ice build system (Makefiles) and everything worked correctly. If you're still having trouble, I recommend comparing your compiler options with those of the projects included in the Ice demo archive (see demos.zip in your Ice installation directory).

    Regards,
    Mark
  • mes
    mes California
    No problem, I'm glad you figured it out.

    Cheers,
    Mark