Archived

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

How to pass arguments into IceBox service

I wanna passing some argument into IceBox service, how do I do that?
I tried:
java IceBox.Server arg0 arg1 arg2 --Ice.Config=config

I got exception like:
Server: unknown option `arg1'
Usage: IceBox.Server [options] --Ice.Config=<file>

Options:
-h, --help Show this message.


I also tried to add <option> tag in Icebox integrate with IceGrid, but get the same exception.

So where should I pass the arguments for each service in the IceBox to use?

Comments

  • I check the src code of ServiceManager and get it. The argument should set in the configuration file instead of command line.
    Like:
    IceBox.Service.name=class args0 args1

    or in xml, set the entry of service as "class args0 args1". I didn't find a way to passing the argument from the command line, but it is make sense, each IceBox may have multiple services, each services may has their independent arguments. But it may still be useful to allow us to passing some argument which all the services may share.

    I suggest these information should covered in Manual because somehow it is easy to confused with running a ice server which can directly passing from command line, and there is also no hint in the manual that running IceBox in Java only allow the property arguments from command line can pass to the IceBox which with prefix "--".

    Thanks,
    Zao
  • matthew
    matthew NL, Canada
    Starting with Ice 3.3, you can also pass properties on the command line with --<Service>.Property. That is if you have:

    IceBox.Service.Foo=....

    You can define on the command line --Foo.A=10 --Foo.B=20