Results 1 to 3 of 3

Thread: IceGrid - Java system properties

  1. #1
    guerjam is offline Registered User
    Name: James Guerrieri
    Organization: Royal Bank of Canada
    Project: Rates Derivatives Pricing
    Join Date
    Mar 2011
    Posts
    2

    IceGrid - Java system properties

    Hi All,

    I'm new to using IceGrid and have developed a small IceGrid application. My app has a main class that extends Ice.Application similar to the samples provided. However, unlike some of the samples, I'd like to dynamically resolve the config file used to to pass into the main method of the Ice.Application class.

    For example,

    int status = app.main("Server", args, <derivedConfigFile>);

    When I start the application locally from eclipse, providing -Dserver.config=<filename> in the run configuration works fine. However, when I specify the same system property as an "option" element in the application descriptor, this does not work. The server instance doesn't recognize that a system property was set.

    Application descriptor:

    <server-template id="AuroraServer">
    <parameter name="index" />
    <server id="AuroraServer-${index}" exe="java" activation="on-demand">
    <option>com.rbccm.rce.ice.AuroraServer</option>
    <option>-Dserver.config=config.server.grid</option>
    <env>CLASSPATH=./lib/*;%CLASSPATH%</env>
    <property name="Identity" value="AuroraServer" />
    </server>
    </server-template>


    First and foremost, is there a better way to do this? If not, is there something I'm doing wrong?

    Thanks in advance for the help!

    Jim

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Jim,

    Welcome to our forums!

    When you use IceGrid to manage a server (start, monitor, stop this server), IceGrid generates the Ice configuration file for this server from your description of this server.

    For example:
    Code:
    <property name="Identity" value="AuroraServer" />
    will become
    Code:
    Identity=AuroraServer
    in the config file that IceGrid generates for this server.

    When IceGrid launches the server, it passes --Ice.Config=<path to generated config file>, so it's critical that you give this argument to Ice (here the Ice.Application main method).

    Code:
      // when launched with IceGrid, args contains --Ice.Config=...
       int status = app.main("Server", args);
    You don't need to pass your own config file or worry about finding the location of the file generated by IceGrid.

    I hope this is clearer now!

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    guerjam is offline Registered User
    Name: James Guerrieri
    Organization: Royal Bank of Canada
    Project: Rates Derivatives Pricing
    Join Date
    Mar 2011
    Posts
    2
    Hi Bernard,

    Thank you for your help, it is indeed much clearer now! This has simplified things greatly for me.

    Thanks again,
    Jim

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. java deployment error in icegrid
    By richardma in forum Help Center
    Replies: 1
    Last Post: 05-16-2008, 12:08 AM
  2. Replies: 2
    Last Post: 03-29-2007, 03:26 AM
  3. Can I start 2 registries in one IceGrid system?
    By russule in forum Help Center
    Replies: 3
    Last Post: 02-02-2007, 02:46 AM
  4. Typo in Java Glacier2 demo properties file?
    By bartley in forum Bug Reports
    Replies: 2
    Last Post: 02-09-2006, 04:35 PM
  5. Icegrid java icebox service
    By xdm in forum Help Center
    Replies: 6
    Last Post: 01-09-2006, 03:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •