bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

WebLogic Server Command Reference

 Previous Next Contents Index View as PDF  

weblogic.Server Command-Line Reference

The weblogic.Server class is the main class for a WebLogic Server instance. You start a server instance by invoking weblogic.Server in a Java command. You can invoke the class directly in a command shell or indirectly through scripts or the Node Manager.

This section describes the following:

For information about using scripts to start an instance of WebLogic Server, refer to "Starting Administration Servers" and "Starting Managed Servers From a WebLogic Server Script" in the Administration Console Online Help.

For information about using the Node Manager to start an instance of WebLogic Server, refer to "Managing Server Availability with Node Manager" in the Configuring and Managing WebLogic Server guide.

 


Required Environment and Syntax for weblogic.Server

This section describes the environment that you must set up before you can start a server instance. Then it describes the syntax for invoking weblogic.Server.

Environment

To set up your environment for the weblogic.Server command:

  1. Install and configure the WebLogic Server software, as described in the WebLogic Server Installation Guide
  2. Add WebLogic Server classes to the CLASSPATH environment variable, as described in Setting the Classpath
  3. Include a Java Virtual Machine (JVM) in your PATH environment variable. You can use any JVM that is listed in the Supported Configurations page at http://e- docs.bea.com/wls/certifications/certifications/index.html.

    If you do not include a JVM in the PATH environment variable, you must provide a pathname for the Java executable file that the JVM provides.

Setting the Classpath

The Java Virtual Machine (JVM) uses a setting called classpath to locate essential files and directories.

You can use the following script to set the classpath for a WebLogic Server:

WL_HOME\server\bin\setWLSEnv.cmd (on Windows)
WL_HOME/server/bin/setWLSEnv.sh (on UNIX)

Instead of using setWLSEnv, you can use an environment variable or the -classpath argument in the startup command. Regardless of the method you choose, include the following in the classpath for the JVM that runs instances of WebLogic Server:

Syntax

The syntax for invoking weblogic.Server is as follows:

java [options] weblogic.Server [-help]

The java weblogic.Server -help command returns a list of frequently used options.

 


Default Behavior

If you have set up the required environment described in Environment, when you enter the command java weblogic.Server with no options, WebLogic Server does the following:

  1. Looks in the current directory for a file named config.xml.
  2. If config.xml exists in the current directory, WebLogic Server does the following:
    1. If only one server instance is defined in ./config.xml, it starts that server instance.
    2. For example, if you issue java weblogic.Server from WL_HOME\samples\server\config\medrec, WebLogic Server starts the MedRec server.

    3. If there are multiple server instances defined in ./config.xml, WebLogic Server looks for a server configuration named myserver. If it finds such a server configuration, it starts the myserver instance.
    4. If it does not find a server named myserver, WebLogic Server exits the weblogic.Server process and generates an error message.

  3. If there is no config.xml file in the current directory, WebLogic Server asks if you want to create a domain and server instance. If you answer yes, WebLogic Server does the following:
    1. Creates an server configuration named myserver, and persists the configuration in a file named ./config.xml.
    2. Any options that you specify are presisted to the config.xml file. For example, if you specify -Dweblogic.ListenPort=8001, then WebLogic Server saves 8001 in the config.xml file.

      For any options that you do not specify, the server instance uses default values.

      WebLogic Server uses the username and password that you supply to create a user with administrative privileges.

      Note that the server starts as an Administration Server in a new domain. There are no other servers in this domain, nor are any of your deployments or third-party solutions included. You can add them as you would add them to any WebLogic domain.

    3. Creates two scripts, startmydomain.cmd and startmydomain.sh, that you can use to start subsequent instantiations of the server. You can use a text editor to modify startup options such as whether the server starts in production mode or development mode. The startmydomain script contains comments that describe each option.

 


weblogic.Server Configuration Options

You can use weblogic.Server options to configure the following attributes of a server instance:

Unless you are creating a new domain as described in Using the weblogic.Server Command Line to Create a Domain, all startup options apply to the current server instantiation; they do not modify the persisted values in an existing config.xml file. Use the Administration Console or the weblogic.Admin command to modify the config.xml file.

For information on verifying the WebLogic Server attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

JVM Parameters

The following table describes frequently used options that configure the Java Virtual Machine (JVM) in which the server instance runs. For a complete list of JVM options, refer to the documentation for your specific JVM. For a list of JVMs that can be used with WebLogic Server, refer to the Supported Configurations page at http://download.oracle.com/docs/cd/E13222_01/wls/certifications/certifications/index.html.

Table 3-1 Frequently Used Options for Setting JVM Parameters

Option

Description

-Xms and -Xmx

Specify the minimum and maximum values (in megabytes) for Java heap memory.

For example, you might want to start the server with a default allocation of 200 megabytes of Java heap memory to the WebLogic Server. To do so, you can start the server with the java -Xms200m and -Xmx200m options.

For best performance it is recommended that the minimum and maximum values be the same so that the JVM does not resize the heap.

The values assigned to these parameters can dramatically affect the performance of your WebLogic Server and are provided here only as general defaults. In a production environment you should carefully consider the correct memory heap size to use for your applications and environment.

-classpath

The minimum content for this option is described under Setting the Classpath.

Instead of using this argument, you can use an environment variable named CLASSPATH to specify the classpath.

-client
-server

Used by some JVMs to start a HotSpot virtual machine, which enhances performance. For a list of JVMs that can be used with WebLogic Server, refer to the Supported Configurations page at http://download.oracle.com/docs/cd/E13222_01/wls/certifications/certifications/index.html.

Location of License and Configuration Data

All server instances must have access to license and configuration data. The following table provides options for indicating the location of this data.

Table 3-2 Options for Indicating the Location of License and Configuration Data

Option

Description

-Dbea.home=bea_home

Specifies the location of the BEA home directory, which contains licensing and other essential information.

By default, weblogic.Server determines the location of the BEA home directory based on values in the classpath.

-Dweblogic.RootDirectory=path

Specifies the server's root directory.

By default, the root directory is the directory from which you issue the start command. For more information, refer to "A Server's Root Directory" in the Configuring and Managing WebLogic Server guide.

-Dweblogic.ConfigFile=
file_name

Specifies a configuration file for your domain. The file_name value must refer to a valid XML file that conforms to the config.dtd. The XML file must exist in the Administration Server's root directory, which is either the current directory or the directory that you specify with -Dweblogic.RootDirectory.

The file_name value cannot contain a pathname component. For example, the following value is invalid:

-Dweblogic.ConfigFile=c:\mydir\myfile.xml

Instead, use the following arguments:

-Dweblogic.RootDirectory=c:\mydir
-Dweblogic.ConfigFile=myfile.xml

For information about config.dtd, refer to BEA WebLogic Server Configuration Reference.

If you do not specify this value, the default is config.xml in the server's root directory.

-Dweblogic.Domain=domain

Specifies the name of the domain. This option is not needed unless you are using weblogic.Server to create a domain and you want to give the domain a specific name.

For information on how a Managed Server retrieves its configuration data, refer to the -Dweblogic.management.server entry in Table 3-3 on page 9.

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

Examples

The following example starts an Administration Server instance named SimpleServer. In the example, the config.xml file has been renamed to SimpleDomain.xml and it is located in a directory named c:\my_domains\SimpleDomain. The command itself is issued from the D:\ directory after running WL_HOME\server\bin\setWLSEnv.cmd:

D:\> java -Dweblogic.Name=SimpleServer -Dweblogic.ConfigFile=SimpleDomain.xml -Dweblogic.RootDirectory=c:\my_domains\SimpleDomain weblogic.Server

The following example starts a Managed Server instance named SimpleManagedServer. Specifying a config.xml file is not valid because Managed Servers contact the Administration Server for their configuration data. Multiple instances of WebLogic Server can use the same root directory. However, if your server instances share a root directory, make sure that all relative filenames are unique. In this example, SimpleManagedServer shares its root directory with SimpleServer. The command itself is issued from the D:\ directory after running WL_HOME\server\bin\setWLSEnv.cmd:

D:\> java -Dweblogic.Name=SimpleManagedServer -Dweblogic.management.server=localhost:7001 -Dweblogic.RootDirectory=c:\my_domains\SimpleDomain weblogic.Server

Server Communication

The following table describes the options for configuring how servers communicate.

Table 3-3 Options for Configuring Server Communication

Option

Description

-Dweblogic.management.server=[protocol]Admin-host:port

Starts a server instance as a Managed Server and specifies the Administration Server that will configure and manage the server instance.

The domain's configuration file does not specify whether a server configuration is an Administration Server or a Managed Server. You determine whether a server instance is in the role of Administration Server or Managed Server with the options that you use to start the instance. If you omit the -Dweblogic.management.server option in the start command, the server starts as an Administration Server (although within a given domain, there can be only one active Administration Server instance). Once an Administration Server is running, you must start all other server configurations as Managed Servers by including the -Dweblogic.management.server option in the start command.

For protocol, specify HTTP, HTTPS, T3, or T3S. The T3S and HTTPS protocols require you to enable SSL on the Managed Server and the Administration Server and specify the Administration Server's SSL listen port.

Note: Regardless of which protocol you specify, the initial download of a Managed Server's configuration is over HTTP or HTTPS. After the RMI subsystem initializes, the server instance can use the T3 or T3S protocol.

For Admin-host, specify localhost or the DNS name or IP address of the machine where the Administration Server is running.

For port, specify the Administration Server's listen port. If you set up the domain-side administration port, port must specify the domain-wide administration port.

For more information on configuring a connection to the Administration Server, refer to "Configuring a Connection to the Administration Server" in the Administration Console Online Help.

-Dweblogic.ListenAddress=host

Specifies the address at which this server instance listens for requests. The host value must be either the DNS name or the IP address of the computer that is hosting the server instance.

This startup option overrides any listen address value specified in the config.xml file. The override applies to the current server instantiation; it does not modify the value in the config.xml file. Use the Administration Console or the weblogic.Admin command to modify the config.xml file.

We recommend that you specify a known IP address or DNS name and that you use the Administration Console instead of this argument to do so.

For more information, refer to "Setting the Listen Address" in the Configuring and Managing WebLogic Server guide.

-Dweblogic.ListenPort=
portnumber

Enables and specifies the plain-text (non-SSL) listen port for the server instance.

This startup option overrides any listen port value specified in the config.xml file. The override applies to the current server instantiation; it does not modify the value in the config.xml file. Use the Administration Console or the weblogic.Admin command to modify the config.xml file.

The default listen port is 7001.

For more information, refer to "Setting the Listen Ports" in the Configuring and Managing WebLogic Server guide.

-Dweblogic.ssl.ListenPort=
portnumber

Enables and specifies the port at which this WebLogic Server instance listens for SSL connection requests.

This startup option overrides any SSL listen port value specified in the config.xml file. The override applies to the current server instantiation; it does not modify the value in the config.xml file. Use the Administration Console or the weblogic.Admin command to modify the config.xml file.

The default SSL listen port is 7002.

For more information, refer to "Setting the Listen Ports" in the Configuring and Managing WebLogic Server guide.

-Dweblogic.management.
discover={true | false}

Determines whether an Administration Server recovers control of a domain after the server fails and is restarted.

A true value causes an Administration Server to refer to its running-managed-servers.xml file, which contains information about the deployment state of deployable modules and a list of all Managed Servers that are currently running. When the Administration Server starts with this specified as true, it communicates with the Managed Servers and informs them that the Administration Server is running.

A false value prevents an Administration Server from referring to this file and thus prevents it from communicating with any Managed Servers that are currently active in the domain.

Caution: Specify false for this option only in the development environment of a single server. Specifying false can cause server instances in the domain to have an inconsistent set of deployed modules.

If you start server instances in Development Mode, the default value is false. If you start server instances in Production Mode, the default value is true. For more information, refer to "Starting in Development Mode or Production Mode" in the Administration Console Online Help.

For information on re-establishing administrative control over Managed Servers after an Administration Server has already started, refer to DISCOVERMANAGEDSERVER.

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

SSL

Each Weblogic Server instance uses an instance of weblogic.management.security.SSLMBean to represent its SSL configuration. All of the options in the following table that start with -Dweblogic.security.SSL modify the configuration of the server's SSLMBean. For example, the -Dweblogic.security.SSL.ignoreHostnameVerification option sets the value of the SSLMBean's ignoreHostnameVerification attribute.

The following table describes the options for configuring a server to communicate using Secure Sockets Layer (SSL).

Table 3-4 Options for Configuring SSL

Option

Description

-Dweblogic.security.SSL.
ignoreHostnameVerification=
true

Disables host-name verification, which enables you to use the demonstration digital certificates that are shipped with WebLogic Server.

By default, when a WebLogic Server instance is in the role of SSL client (it is trying to connect to some other server or application via SSL), it verifies that the host name that the SSL server returns in its digital certificate matches the host name of the URL used to connect to the SSL server. If the host names do not match, the connection is dropped.

If you disable host name verification, either by using this option or by modifying the server's configuration in the config.xml file, the server instance does not verify host names when it is in the role of SSL client.

Note: BEA does not recommend using the demonstration digital certificates or turning off host name verification in a production environment.

This startup option overrides any Host Name Verification setting in the config.xml file. The override applies to the current server instantiation; it does not modify the value in the config.xml file. Use the Administration Console or the weblogic.Admin command to modify the config.xml file.

For more information, refer to "Using a Hostname Verifier" in the Managing WebLogic Security guide.

-Dweblogic.security.SSL.
HostnameVerifier=
hostnameverifierimplmentation

Specifies the name of a custom Host Name Verifier class. The class must implement the weblogic.security.SSL.HostnameVerifier interface.

-Dweblogic.security.SSL.
sessionCache.size=
sessionCacheSize

-Dweblogic.security.SSL.
sessionCache.ttl=
sessionCacheTimeToLive

Modifies the default server-session caching size and time-to-live for SSL session caching.

The sessionCacheSize value specifies the number of items in session cache and the sessionCacheTimeToLive value specifies (in seconds) the session cache time-to-live.

For sessionCache.size:

  • The minimum value is 1

  • The maximum value is 65537

  • The default value is 211

For sessionCache.ttl:

  • The minimum value is 1

  • The maximum value is Integer.MAX_VALUE

  • The default value is 600

-Dweblogic.management.
pkpassword=
pkpassword

Specifies the password for retrieving SSL private keys from an encrypted flat file.

Use this option if you store private keys in an encrypted flat file.

-Dweblogic.security.SSL.
trustedCAKeyStore=
path

Deprecated and ignored by default.

If you configure a server instance to use the SSL features that were available before WebLogic Server 8.1, you can use this argument to specify the certificate authorities that the server or client trusts. The path value must be a relative or qualified name to the Sun JKS keystore file (contains a repository of keys and certificates).

If a server instance is using the SSL features that were available before 8.1, and if you do not specify this argument, the WebLogic Server or client trusts all of the certificates that are specified in JAVA_HOME\jre\lib\security\cacerts.

We recommend that you do not use the demonstration certificate authorities in any type of production deployment.

For more information, refer to "Configuring the SSL Protocol" in the Managing WebLogic Security guide.

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

Setting Additional SSL Attributes

To set additional SSL attributes from the startup command, do the following:

  1. To determine which SSL attributes can be configured from startup options, view the WebLogic Server Javadoc for the SSLMBean and ServerMBean. The Javadoc also indicates valid values for each attribute.

    Each attribute that SSLMBean and ServerMBean expose as a setter method can be set by a startup option.

  2. To set attributes in the SSLMBean, add the following option to the start command:
    -Dweblogic.ssl.attribute-name=value

    where attribute-name is the name of the MBean's setter method without the set prefix.

  3. To set attributes in the ServerMBean, add the following option to the start command:
    -Dweblogic.server.attribute-name=value

    where attribute-name is the name of the MBean's setter method without the set prefix.

For example, the SSLMBean exposes its Enabled attribute with the following setter method:

setEnabled()

To enable SSL for a server instance named MedRecServer, use the following command when you start MedRecServer:

java -Dweblogic.Name=MedRecServer
-Dweblogic.ssl.Enabled=true weblogic.Server

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

Security

The following table describes the options for configuring general security parameters. Table 3-4 on page 3-12 describes options for setting SSL parameters.

Table 3-5 Options for General Security Parameters

Option

Description

-Dweblogic.management.
username=
username

Specifies the username under which the server instance will run.

The username must belong to a role that has permission to start a server. For information on roles and permissions, refer to "Protecting System Administration Operations" in the Configuring and Managing WebLogic Server guide.

Instead of using this argument, you can use a boot identity file. For more information, refer to "Bypassing the Prompt for Username and Password" in the Administration Console Online Help.

-Dweblogic.management.
password=
password

Specifies the user password.

Instead of using this argument, you can use a boot identity file. For more information, refer to "Bypassing the Prompt for Username and Password" in the Administration Console Online Help.

-Dweblogic.system.
StoreBootIdentity=true

Creates a boot.properties file in the server's root directory. The file contains the username and an encrypted version of the password that you used to start the server.

Do not specify this argument in a server's ServerStartMBean (Remote Startup tab in the Administration Console). For more information, refer to "Specifying User Credentials When Starting a Server with the Node Manager" in the Administration Console Online Help.

Also, we recommend that you do not add this argument to a startup script. Instead, use it only when you want to create a boot.properties file.

For more information, refer to "Bypassing the Prompt for Username and Password" in the Administration Console Online Help.

-Dweblogic.system.
BootIdentityFile=
filename

Specifies a boot identity file that contains a username and password.

The filename value must be the fully qualified pathname of a valid boot identity file. For example:
-Dweblogic.system.BootIdentityFile=C:\BEA\
wlserver8.1\user_config\mydomain\myidentity.prop

If you do not specify a filename, a server uses the boot.properties in the server's root directory. If there is no boot identity file, the server prompts you to enter a username and password.

-Dweblogic.system.
RemoveBootIdentity=true

Removes the boot identity file after a server starts.

-Dweblogic.security.anonymousUserName=name

Assigns a user ID to anonymous users. By default, all anonymous users are identified with the string <anonymous>.

To emulate the security behavior of WebLogic Server 6.x, specify guest for the name value and create a user named guest in your security realm.

For more information, refer to Defining Users in the Managing WebLogic Security guide.

-Djava.security.manager

-Djava.security.policy=
filename

Standard J2EE options that enable the Java 2 security manager and specifiy a filename (using a relative or fully-qualified pathname) that contains Java 2 security policies.

To use the WebLogic Server sample policy file, specify WL_HOME\server\lib\weblogic.policy. For more information, refer to Modifying the weblogic.policy File for General Use in the Managing WebLogic Security guide.

-Dweblogic.security.fullyDelegateAuthorization=true

By default, roles and security policies cannot be set for an EJB or Web application through the Administration Console unless security constraints were defined in the deployment descriptor for the EJB or Web application.

Use this command-line argument when starting WebLogic Server to override this problem.

This command-line argument does not work with EJBs or EJB methods that use <unchecked> or <restricted> tags or Web applications that do not have a role-name specified in the <auth-constraint> tag.

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

Message Output and Logging

The following table describes options for configuring a server instance's message output.

Table 3-6 Options for Configuring Message Output

Option

Description

-Dweblogic.Stdout="filename"

Redirects the JVM's standard output stream to a file. You can specify a pathname that is fully qualified or relative to the WebLogic Server root directory.

Use this option to keep a record of the messages from the JVM that are not sent to a WebLogic Server log. For example, a JVM can print verbosegc messages to standard out but not to the WebLogic Server log. For more information, refer to "Redirecting JVM Messages to a File" in the Administration Console Online Help.

-Dweblogic.Stderr="filename"

Redirects the JVM's standard error stream to a file. You can specify a pathname that is fully qualified or relative to the WebLogic Server root directory.

Use this option to keep a record of the error messages from the JVM that are not sent to a WebLogic Server log. For more information, refer to "Redirecting JVM Messages to a File" in the Administration Console Online Help.

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

Setting Logging Attributes

Each Weblogic Server instance uses an instance of weblogic.management.configuration.LogMBean to represent the configuration of its logging services.

To set values for LogMBean attributes from the startup command, do the following:

  1. To determine which log attributes can be configured from startup options, view the WebLogic Server Javadoc for the LogMBean. The Javadoc also indicates valid values for each attribute.

    Each attribute that the LogMBean exposes as a setter method can be set by a startup option.

  2. Add the following option to the start command:
    -Dweblogic.log.attribute-name=value

    where attribute-name is the name of the MBean's setter method without the set prefix.

The LogMBean exposes its FileName attribute with the following setter method:

setFileName()

To specify the name of the MedRecServer instance's local log file, use the following command when you start MedRecServer:

java -Dweblogic.Name=MedRecServer
-Dweblogic.log.FileName="C:\logfiles\myServer.log"
weblogic.Server

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

Other Server Configuration Options

The following table describes options for configuring additional attributes of a server instance.

Table 3-7 Options for Configuring Server Attributes

Option

Description

-Dweblogic.Name=
servername

Specifies the name of the server instance that you want to start. The specified value must refer to the name of a server that has been defined in the domain's config.xml file.

-Dweblogic.ProductionModeEnabled=
{true | false}

Determines whether a server starts in production mode.

A true value prevents a WebLogic Server from automatically deploying and updating applications that are in the domain_name/applications directory.

If you do not specify this option, the assumed value is false.

For more information, refer to "Starting in Development Mode or Production Mode" in the Administration Console Online Help.

-Dweblogic.management.
startupMode=STANDBY

Starts a server and places it in the STANDBY state. To use this startup argument, the domain must be configured to use the domain-wide administration port.

For information about administration ports, refer to "Enabling the Domain-Wide Administration Port" in the Configuring and Managing WebLogic Server guide.

This startup option overrides any startup mode setting in the config.xml file. The override applies to the current server instantiation; it does not modify the value in the config.xml file. Use the Administration Console or the weblogic.Admin command to modify the config.xml file.

If you do not specify this value (either on the command line or in config.xml), the default is to start in the RUNNING state.

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

Setting Additional Server Attributes

Each Weblogic Server instance uses an instance of weblogic.management.security.ServerMBean to represent its overall configuration.

To set values for ServerMBean attributes from the startup command, do the following:

  1. To determine which log attributes can be configured from startup options, view the WebLogic Server Javadoc for the ServerMBean. The Javadoc also indicates valid values for each attribute.

    Each attribute that the ServerMBean exposes as a setter method can be set by a startup option.

  2. Add the following option to the start command:
    -Dweblogic.server.attribute-name=value

    where attribute-name is the name of the MBean's setter method without the set prefix.

The ServerMBean exposes its StdoutSeverityLevel attribute with the following inherited setter method:

setStdoutSeverityLevel()

To specify the severity level of messages that the MedRecServer instance prints to standard out, use the following command when you start MedRecServer:

java -Dweblogic.Name=MedRecServer
-Dweblogic.StdoutSeverityLevel=64
weblogic.Server

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

Clusters

Each server in a cluster uses a local instance of weblogic.management.configuration.ClusterMBean to represent its view of the cluster configuration. If you want server instances to use a cluster configuration that is different from the values in the config.xml file (or that is unspecified in config.xml), you can set values of the ClusterMBean from the start command.

For example, when you create a cluster, instead of using the Administration Console to define the multicast address, you can leave this attribute undefined. Then, when you start each server instance for the cluster, you use the -Dweblogic.cluster.MulticastAddress startup option to specify the multicast address. Because all servers in a cluster must use the same multicast address, you must use the same startup option and value for each server instance in the cluster.

To set a server instance's view of a cluster from the startup command, do the following:

  1. To determine which cluster attributes can be configured from startup options, view the WebLogic Server Javadoc for the ClusterMBean. The Javadoc also indicates valid values for each attribute.

    Each attribute that the ClusterMBean exposes as a setter method can be set by a startup option.

  2. Add the following option to the start command:
    -Dweblogic.cluster.attribute-name=value

    where attribute-name is the name of the MBean's setter method without the set prefix.

For example, the ClusterMBean exposes its multicast address attribute with the following setter method:

setMulticastAddress()

To set the multicast address value for a cluster member named MRServer 1, use the following command when you start MRServer1:

java -Dweblogic.Name=MRServer1
-Dweblogic.cluster.MulticastAddress=239.0.0.32 weblogic.Server

The Administration Console does not display values that you set on the command line. For information on verifying the attribute values that you set, refer to Verifying Attribute Values That Are Set on the Command Line.

 


Using the weblogic.Server Command Line to Start a Server Instance

A simple way to start a server instance is as follows:

  1. In a command shell, set up the required environment variables by running the following script:
    WL_HOME\server\bin\setWLSEnv.cmd (on Windows)
    WL_HOME/server/bin/setWLSEnv.sh (on UNIX)

    where WL_HOME is the directory in which you installed the WebLogic Server software.

  2. In the command shell, change to the directory that contains your domain's config.xml file. For example, change to the WL_HOME\samples\server\config\medrec directory.
  3. To start an Administration Server, enter the following command:
    java -Dweblogic.Name=servername weblogic.Server

    where servername is the name of a server configuration that already exists in the config.xml file.

    For example, enter the following command to start the MedRec server:
    java -Dweblogic.Name=MedRecServer weblogic.Server

  4. If the domain's Administration Server is already running, and if you have already defined a Managed Server in the config.xml file, you can start a Managed Server as follows:
    java -Dweblogic.Name=managed-server-name
    -Dweblogic.management.server=url-for-Administration-Server
    weblogic.Server

    For example, if you create a Managed Server named MedRecManagedServer in the MedRec domain, you can enter the following command:
    java -Dweblogic.Name=MedRecManagedServer
    -Dweblogic.management.server=localhost:7001
    weblogic.Server

 


Using the weblogic.Server Command Line to Create a Domain

You can use weblogic.Server to create a domain that contains a single server instance. You cannot use weblogic.Server to add Managed Server instances to a domain, nor can you use weblogic.Server to modify an existing domain.

As described in Default Behavior, if weblogic.Server is unable to find a config.xml file, it offers to create the file. Any command option that you specify and that corresponds to an attribute that is persisted in the config.xml file will be persisted. For example, the -Dweblogic.Name and -Dweblogic.Domain options specify the name of a server configuration and the name of a domain. If weblogic.Server is unable to find a config.xml file, both of these values are persisted in config.xml. However, the -Dweblogic.system.BootIdentityFile option, which specifies a file that contains user credentials for starting a server instance, is not an attribute that the config.xml file persists.

To create and instantiate a simple example domain and server, do the following:

  1. In a command shell, set up the required environment variables by running the following script:
    WL_HOME\server\bin\setWLSEnv.cmd (on Windows)
    WL_HOME/server/bin/setWLSEnv.sh (on UNIX)

    where WL_HOME is the directory in which you installed the WebLogic Server software.

  2. In the command shell, create an empty directory.
  3. In the empty directory, enter the following command:
java -Dweblogic.Domain=SimpleDomain -Dweblogic.Name=SimpleServer    -Dweblogic.management.username=weblogic -Dweblogic.management.password=weblogic   -Dweblogic.ListenPort=7701 weblogic.Server 

After you enter this command, WebLogic Server asks if you want to create a new config.xml file. If you enter y, it asks you to confirm the password. Then it instantiates a domain named SimpleDomain. The domain's Administration Server is configured as follows:

Enter the weblogic.Server command as described in this section creates the following files:

 


Verifying Attribute Values That Are Set on the Command Line

To verify that the server instance is using the values that you passed on the command line, use the weblogic.Admin utility as follows:

java weblogic.Admin -url url-for-server-instance -username username -password password GET -type MBean-nameConfig -property attribute-name

For example, to determine the multicast address that a cluster member is using, enter the following command, where MRMachine1:7041 is the listen address and port of the cluster member:

java weblogic.Admin -url MRMachine1:7041 -username weblogic -password weblogic GET -type ClusterConfig -property MulticastAddress

To determine the severity level of messages that the example MedRecServer prints to standard out, enter the following command:

java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic GET -type ServerConfig -property StdoutSeverityLevel

The Administration Console does not display values that you set on the command line because the startup options set attribute values for the server's Local Configuration MBean. For more information about Local Configuration MBeans, refer to "Overview of WebLogic JMX Services" in the Programming WebLogic Server Management Services with JMX guide.

For more information on using the weblogic.Admin utility, refer to weblogic.Admin Command-Line Reference.

 

Back to Top Previous Next