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

Help with application descriptions deployment and Icegrid

Hello everyone,

I've been reading on the forum for quite a while now. But this time i couldn't find an answer related to my problem.

I am trying to dynamically add Application Descriptions to my Icegridnode. I've figured there are 3 Ways to achieve this.

1.Start icegridadmin from my C# Application and pass the .xml via the command line

2.Establish an Admin Session to the Registry and Parse the xml file via icegridadmin in server mode

3.Skip the XML file and directly create the Application Description through an Admin Session.

Solution 1 already works but I really don't like this kind of work around.
Solution 2 is also working but I could'n yet figure out howto access icegridadmin via an indirect proxy and is it possible to use the FileParser without icegridadmin running?

I'd prefer solution Number 3 since all the necessary informations are already available from my so I could directly pass them from my data structure.

Here's my attempt
.... communicator initialization code .....
 Ice.ObjectPrx obj = ic.stringToProxy("IceGrid/Registry");
 IceGrid.RegistryPrx registry = RegistryPrxHelper.checkedCast(obj);
 string user = "xxx";
 string pass = "xxx";
 IceGrid.AdminSessionPrx session;

 session = registry.createAdminSession(user, pass);
 IceGrid.AdminPrx admin = session.getAdmin()

The Connection up to this point is working. I can request node info,adapter names,etc....
 IceGrid.ApplicationDescriptor myApp = new IceGrid.ApplicationDescriptor(); = "Some Simulation";
     myApp.nodes = new Dictionary<string,IceGrid.NodeDescriptor>();
      myApp.nodes.Add("node1", new IceGrid.NodeDescriptor());
If i run
at this points it works just fine. The Application is added to the registry.

My node is named "node1" in the registry config if that matters.

Now for the server/adapter part
myApp.nodes["node1"].servers = new IceGrid.ServerDescriptor[1];
myApp.nodes["node1"].servers[0] = new IceGrid.ServerDescriptor();
     myApp.nodes["node1"].servers[0].id = "test";
    myApp.nodes["node1"].servers[0].exe = "test.exe";
      myApp.nodes["node1"].servers[0].activation = "manual";
      myApp.nodes["node1"].servers[0].adapters = new IceGrid.AdapterDescriptor[1];
      myApp.nodes["node1"].servers[0].adapters[0] = new IceGrid.AdapterDescriptor();
      myApp.nodes["node1"].servers[0].adapters[0].name = "testadapter";
      myApp.nodes["node1"].servers[0].adapters[0].id = "testadapter";

even the first line is enough to trigger a "Deployment Exception". I probably missed something or is it even possible to deploy an application description this way ?

Any help would be appreciated.


  • benoit
    benoit Rennes, France
    Hi Tobias,

    The DeploymentException contains a "reason" string member that should give you some hints on the reason of the failure to add the application. What does it say?

    I suspect the problem is caused by a missing property to configure the endpoints of the object adapter. Try adding:
    myApp.nodes["node1"].servers[0].propertySet = new IceGrid.PropertySetDescriptor();
    myApp.nodes["node1"].servers[0] = new IceGrid.PropertyDescriptor[1];
    myApp.nodes["node1"].servers[0][0] = new IceGrid.PropertyDescriptor();
    myApp.nodes["node1"].servers[0][0].name = "testadapter.Endpoints";
    myApp.nodes["node1"].servers[0][0].value = "tcp";

  • Thanks a lot Benoit !

    The reason string would've pointed me to the missing endpoint too.
    So your guess was absolutely correct and its working as intended now!

    Problem solved.