Archived

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

A question about IceGrid

I want let my IceGrid integrated with IceBox application. So I write the following configuration.

IceRegistry cofiguration:

IceGrid.InstanceName=DemoIceGrid

IceGrid.Registry.Client.Endpoints=tcp -p 4061
IceGrid.Registry.Server.Endpoints=tcp
IceGrid.Registry.Internal.Endpoints=tcp
IceGrid.Registry.PermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
IceGrid.Registry.AdminPermissionsVerifier=DemoIceGrid/NullPermissionsVerifier
IceGrid.Registry.Data=db/master
IceGrid.Registry.DynamicRegistration=1

IceNode configuration:

Ice.Default.Locator=DemoIceGrid/Locator:default -p 4061

IceGrid.Node.Name=node1
IceGrid.Node.Endpoints=default
IceGrid.Node.Data=db/node

And application.xml:

<icegrid>
<application name="IceBoxDemo">
<node name="node1">
<icebox id="IceBoxServer" activation="on-demand" exe="java">
<description>A sample IceBox server</description>
<option>IceBox.Server</option>
<properties>
<property name="Ice.Admin.InstanceName" value="DemoIceBox"/>
<property name="Ice.Admin.Endpoints" value="tcp -h 127.0.0.1"/>
<property name="IceBox.Trace.ServiceObserver" value="1"/>
</properties>
<service name="ServiceA" entry="server.HelloServiceI">
<adapter name="${service}" endpoints="tcp"/>
</service>
</icebox>
</node>
</application>
</icegrid>

So I can use icegridadmin operate Icegrid. I meet the exception when I use "server start IceBoxServer".

icegridadmin --Ice.Config=config.grid
user id: test
password:
Ice 3.4.1 Copyright 2003-2010 ZeroC, Inc.
>>> application list
IceBoxDemo
>>> server list
IceBoxServer
>>> server start IceBoxServer
error: the server didn't start successfully:
The server terminated unexpectedly with exit code 1.

The icegridnode show some error info:

>icegridnode --Ice.Config=config.grid
!! 11-2-9 21:42:43:593 IceBoxServer: error: main: ServiceManager: class server.HelloServiceI not found
IceBox.FailureException
reason = "ServiceManager: class server.HelloServiceI not found"
at IceBox.ServiceManagerI.start(ServiceManagerI.java:487)
at IceBox.ServiceManagerI.run(ServiceManagerI.java:355)
at IceBox.Server.run(Server.java:54)
at Ice.Application.doMain(Application.java:200)
at Ice.Application.main(Application.java:180)
at IceBox.Server.main(Server.java:32)

How can I set my java IceBox application's environment?!

Comments

  • bernard
    bernard Jupiter, FL
    Hello,

    You can use the <env> attribute to set environment variables in the servers started by IceGrid. See this section of the Ice manual for details (bottom of the page). There is also an example for IceBox (with <env>) on that page.

    Best regards,
    Bernard
  • very nice
    bernard wrote: »
    Hello,

    You can use the <env> attribute to set environment variables in the servers started by IceGrid. See this section of the Ice manual for details (bottom of the page). There is also an example for IceBox (with <env>) on that page.

    Best regards,
    Bernard

    Thanks a lot. I change my config.grid as follow, everything is OK!

    <icegrid>
    <application name="IceBoxDemo">
    <node name="node1">
    <icebox id="IceBoxServer" activation="on-demand" exe="java">
    <description>A sample IceBox server</description>
    <option>-Djava.ext.dirs=d:/demo/icegrid/;C:/Ice-4.3.1/lib/</option>
    <option>IceBox.Server</option>
    <properties>
    <property name="Ice.Admin.InstanceName" value="DemoIceBox"/>
    <property name="Ice.Admin.Endpoints" value="tcp -h 127.0.0.1"/>
    <property name="IceBox.Trace.ServiceObserver" value="1"/>
    </properties>
    <service name="ServiceA" entry="server.HelloServiceI">
    <adapter name="${service}" endpoints="tcp"/>
    </service>
    </icebox>
    </node>
    </application>
    </icegrid>
  • Another question

    Hi, all

    If i start server manualy everything is ok.
    But if i try to start server from icegridadmin then server crushes with 0xc015002 error.

    My application config:

    <?xml version="1.0" encoding="utf-8"?>
    <icegrid>
    <application name="Solution">
    <node name="ModelNode">
    <server id="ModelServer"
    exe="C:\Users\MSP\Documents\Visual Studio 2010\Projects\Solution\Debug\c_TableModel.exe"
    activation="on-demand">
    <adapter name="Model:SimpleAdapter" id="Model:SimpleAdapter" endpoints="tcp"/>
    <property name="Freeze.Model" value="D:\ICE\4.3.1\FreezeModel"/>
    <env>PATH=C:\Users\MSP\Documents\Visual Studio 2010\Projects\Solution\Debug;%PATH%</env>
    </server>
    </node>
    </application>
    </icegrid>

    How to fix it ?
    Thanks.
  • bernard
    bernard Jupiter, FL
    Hi Max,

    You should double-check that you're using the correct "bin" directory for the Ice C++ DLLs.

    If you're using Visual Studio 2010, it should be <ice home>\bin\vc100 (32 bit binaries) or <ice home>\bin\vc100\x64 (64 bit binaries).

    Best regards,
    Bernard