Example syntax for the <server> element

The following example illustrates how to use the <server> element of the <registry> element in config.xml to set various server properties.

<registry roles="...,...,...,...">
  <server env="..." serverid="..." roles="..." />
</registry>

Use the roles attribute to list the valid server roles for your installation. However, the existence of the <server> element is a legacy artifact. Guidewire discourages the use of the <server> element. Instead, use JVM options to set these values.

Using a JVM option to set server properties

Guidewire recommends that you set server system properties using a -D JVM option from a command prompt at server startup. For example, you can use JVM options to set the environment variable (env) and the server ID and server roles (serverid) at runtime using the syntax listed in the following table. The option syntax varies by server type. Notice the entries for serverid. The use of a starting # mark indicates that the following text is a server role and not a server ID.

Server type Syntax Example

QuickStart (Jetty)

-Denv=...

-Dserverid=...

gwb runServer -Denv=test2

gwb runServer -Dserverid=t2#messaging

Tomcat

-Dgw.pc.env=...

-Dgw.pc.serverid=...

-Dgw.pc.env=test2

-Dgw.pc.serverid=t2#messaging

If you are starting the Jetty development server in Guidewire Studio™ for PolicyCenter, use the syntax for Tomcat in the Run - Server configuration dialog, for example:
  • -Dgw.pc.serverid=testServer

For more information, see Start the application server from Guidewire Studio for PolicyCenter.

How PolicyCenter uses a -D JVM option

The values of env and serverid are immutable while the server is running.

PolicyCenter determines the value of a -D option in the following manner, using -Dserverid (on Jetty) as an example:

  • If you specify a -Dserverid=prodserver JVM option at the command prompt at server startup, PolicyCenter sets the value of serverid for that server to prodserver.
  • If you do not specify a -Dserverid JVM option at server start, PolicyCenter checks the server registry for a serverid value defined by a server entry. If found, PolicyCenter uses that value. In the example, the serverid value is prodserver.
  • If you do not specify the JVM option, and no serverid value defined by a server entry exists, PolicyCenter sets serverid to the host name of the computer. Under some extreme security settings, this value is not available, in which case PolicyCenter sets the serverid to localhost.
Note: Log entries display only the first 10 characters of the serverid value.

Viewing server information in PolicyCenter

PolicyCenter shows the serverid and role values for each server in a PolicyCenter cluster on the Server Tools Cluster Members and Components screens. You must log in as an administrative user to access the Server Tools.