![]() |
![]() |
e-docs > WebLogic Server > Administration Guide > Starting and Stopping WebLogic Servers |
Administration Guide
|
Starting and Stopping WebLogic Servers
The following sections describe procedures for starting and stopping Administration Servers and Managed Servers:
A WebLogic Server can be in one of several states at any given time, and it follows a set of rules that determine how and when it can transition between those states. The series of states through which a server transitions is called the server lifecycle. (See Figure 2-1.)
Figure 2-1 The Server Lifecycle
The most common pattern of transitions is as follows:
An Administration Server retrieves the configuration data (including security configuration data) from the domain's configuration files. A Managed Server contacts the Administration Server for its configuration and security data. If you set up SSL, a Managed Server uses its own set of certificate files, key files, and other SSL-related files and contacts the Administration Server for the remaining configuration and security data.
When you issue a graceful shutdown, the server invokes any shutdown classes that you have configured. You can shut down a server gracefully only from the RUNNING or STANDBY states.
When you issue a forceful shutdown, the server notifies all applications and subsystems to drop all current work and release all resources. A forceful shutdown could result in rolled back transactions and session loss for some clients. You can shut down a server forcefully from any state.
A server can be in two additional states:
Controlling the Server Lifecycle
You can use any of the following interfaces to control a server's lifecycle:
An additional command, GETSTATE, returns the current state of a server.
For information about using the weblogic.Admin utility, refer to WebLogic Server Command-Line Interface Reference, or enter the following command at a command line:
For information about the Node Manager, refer to Managing Server Availability with Node Manager in the Creating and Configuring WebLogic Server Domains Guide.
Timeout Period for LifeCycle Operations
When you issue a lifecycle command, the server notifies subsystems and applications of the requests and waits a number of seconds for the subsystems and application to respond. If they do not respond in the specified number of seconds, the server times out the lifecycle operation. The actions that it takes after the timeout depend on the operation.
This timeout period applies only to the SHUTDOWN and FORCESHUTDOWN operations. If the operation does not complete within the configured period, one of the following occurs:
You can change the default timeout period on the Server
Providing Usernames and Passwords to Start a Server
By default, a WebLogic Server prompts you to enter a username and password in the command shell that runs the server process. The username must belong to a role that is permitted to start servers. For information on roles and permissions, refer to Protecting System Administration Operations.
This section describes the following tasks:
Specifying an Initial Administrative Username
The Configuration Wizard prompts you to provide a username and password, which becomes the initial administrative username for the myrealm security realm. A security realm is a collection of components (providers) that authenticate usernames, determine the type of resources that the user can access, and provide other security-related services for WebLogic resources. WebLogic Server installs the myrealm security realm and uses it by default.
The first time you start a WebLogic Server, enter this initial administrative username and password. If you did not use the Configuration Wizard, the WebLogic Server prompts you to enter a initial username and password.
You can use the Administration Console to add users to myrealm. If you use an Authentication provider other than the one that WebLogic Server installs, you must use the provider's administration tools to create at least one user with administrative privileges. For information on granting administrative privileges, refer to Protecting System Administration Operations.
Note: The guest user is no longer supplied by default in WebLogic Server version 7.0. To use the guest user, you must run in Compatibility mode or define the guest user as a user in the Authentication provider for your security realm. For information about Compatibility mode, refer to Using Compatibility Security in the Managing WebLogic Security guide.
You can configure a WebLogic Server to use a different security realm. If you set up different security realms, you must designate one of those realms as the default. During its startup cycle, a WebLogic Server uses the default realm to authenticate the username that you supply.
Bypassing the Prompt for Username and Password
If you want to bypass the prompt for username and password, we recommend that you create and use a boot identify file, which contains your username and password in an encrypted format.
This section contains the following subsections:
Creating a Boot Identity File for an Administration Server
To create a boot identity file for an Administration Server:
username=username
password=password
The username and password values must match an existing user account in the Authentication provider for the default security realm and must belong to a role that has permission to start a server. For information on roles and permissions, refer to Protecting System Administration Operations.
If you save the file as boot.properties and locate it in the server's root directory, the server will automatically use this file during startup. For more information, refer to Using a Boot Identity File.
The first time you use this file to start a sever, the server reads the file and then overwrites it with an encrypted version of the username and password.
Alternative Technique for Creating a Boot Identity File for an Administration Server
If you invoke the weblogic.Server class directly on the command line, instead of following the steps in the previous section, you can create a boot identity file by including the following options in the Java command:
-Dweblogic.management.username=username
-Dweblogic.management.password=password
-Dweblogic.system.StoreBootIdentity=true
These options cause the server instance to boot with the supplied user credentials and then store them in a file named boot.properties.
For example, the following command starts an Administration Server named myAdminServer and creates a boot identity file:
java -Dweblogic.management.username=username
-Dweblogic.management.password=password
-Dweblogic.system.StoreBootIdentity=true
-Dweblogic.Name=myAdminServer weblogic.Server
For more information about invoking the weblogic.Server class directly from a command line, refer to Using the weblogic.Server Command.
Note: If you use a script to start an Administration Server, BEA recommends that you do not use the technique described in this section for the following reasons:
Creating a Boot Identity File for a Managed Server
If a Managed Server uses the same root directory as the Administration Server, you do not need to create an additional boot identity file for the Managed Server, unless you want the Managed Server to run under different user credentials. For information about a server's root directory, refer to A Server's Root Directory.
In addition, if you use a Node Manager to start a Managed Server, you do not need to create a boot identity file. Instead, you must specify user credentials on the Managed Server's Remote Start tab in the Administration Console. For more information, refer to "Configure Startup Arguments for Managed Servers."
To create a boot identity file for a Managed Server:
username=username
password=password
The username and password values must match an existing user account in the Authentication provider for the default security realm and must belong to a role that has permission to start a server. For information on roles and permissions, refer to Protecting System Administration Operations.
If you save the file as boot.properties and locate it in the server's root directory, the server will automatically use this file during startup. For more information, refer to Using a Boot Identity File.
A server instance uses a boot identity file as follows:
-Dweblogic.system.BootIdentityFile=filename
where filename is the fully qualified pathname of a valid boot identity file.
If you use the startWebLogic script, add -Dweblogic.system.BootIdentityFile as a value of the JAVA_OPTIONS variable. For example:
JAVA_OPTIONS=-Dweblogic.system.BootIdentityFile=C:\BEA\user_domains\mydomain\myidentity.prop
-Dweblogic.management.username=username
-Dweblogic.management.password=password
These options prevent a server instance from using any boot identity file and override other startup options that cause a server to use boot identity files.
Note: If you use a script to start a server instance, BEA recommends that you do not use this technique because it requires you to store an unencrypted password in the startup script. Use this technique only if you invoke the weblogic.Server class directly from the command line. For more information, see Using the weblogic.Server Command.
For a given server instance, use only the boot identity file that the instance has created. WebLogic Server does not support copying a boot identity file from one server root directory to another.
For example, if you use ServerA to generate a boot identity file, use only that boot identity file with ServerA. Do not copy ServerA's boot identity file into the root directory of ServerB. Instead, create a boot identity file for ServerB as described in the previous sections.
Removing a Boot Identity File After Startup
If you want to remove the boot identity file after a server starts, you can include the following argument in the server's weblogic.Server startup command:
-Dweblogic.system.RemoveBootIdentity=true
This argument removes only the file that the server used to start. For example, if you specify -Dweblogic.system.BootIdentityFile=c:\secure\boot.MyServer, only boot.MyServer is removed, even if the server's root directory contains a file named boot.properties.
Alternate Method: Passing Identity Information on the Command Line
Using a boot identity file is the most secure and convenient way to bypass the interactive prompt. However, instead of using a boot identify file, you can add the following arguments to the weblogic.Server startup command:
-Dweblogic.management.username=username
-Dweblogic.management.password=password
If you supply both of these arguments, you can bypass the interactive prompt.
These options prevent a server instance from using any boot identity file and override other startup options that cause a server to use boot identity files.
Because the command to start a server can be long, typically you place most of the startup command in a script. Unless you are in an environment in which security is not a concern, we recommend that you do not save the -Dweblogic.management.password=password argument in a startup script.
For more information about these arguments, refer to Using the weblogic.Server Command.
Starting an Administration Server
A WebLogic Server runs as a process within a Java Virtual Machine (JVM). Each JVM can host only one server process. To start a server, you initiate a JVM with a set of arguments.
If a domain consists of only one WebLogic Server, that server is the Administration Server. If a domain consists of multiple WebLogic Servers, you must start the Administration Server before you start the Managed Servers.
The Administration Server and all Managed Servers in a domain must be the same WebLogic Server version. The Administration Server must be either at the same service-pack level or at a later service-pack level than the Managed Servers. For example, if the Managed Servers are at release 7.0, then the Administration Server can be either release 7.0 or 7.0 SP1. However, if the Managed Servers are at SP1, then the Administration Server must be at SP1. Each server within a domain must have a unique name.
This section describes starting an Administration Server by completing any of the following tasks from the local host:
Note: When starting WebLogic Server, JDK 1.3 may throw an OutOfMemory error if you are trying to load a large number of classes. This error occurs even though there appears to be plenty of memory available. If you encounter a java.lang.OutOfMemory error exception when you start WebLogic Server, increase the value of the following JVM option:
where <value> is some number in kilobytes.
For JDK1.3.1, the default value for MaxPermSize is 64m, where m stands for megabytes.
Starting an Administration Server from the Windows Start Menu
If you use the Configuration Wizard to create Single Server, an Administration Server with Managed Servers, or an Administration Server with Clustered Managed Servers on a Windows computer, the wizard prompts you to install the domain in the Windows Start Menu. If you choose yes, then you can do the following to start the Single Server or Administration Server:
From the Windows desktop, click Start
The Start Server command opens a command window and calls the domain_name\startWebLogic.cmd script, which is described in Starting an Administration Server Using a Script. When the server has successfully completed its startup process, it writes the following message to the command window:
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Starting an Administration Server Using a Script
Because the arguments needed to start a WebLogic Server from the command line can be lengthy and prone to error, we recommend that you incorporate the command into a script.
This section describes the following tasks:
Using the Configuration Wizard Scripts to Start an Administration Server
When you use the Configuration Wizard to create a domain, the wizard also creates a script that you can use to start an Administration Server for the domain. To use the script, enter one of the following commands at a command prompt:
The script sets values for some domain-specific variables and then calls the master startup script, WL_HOME\server\bin\startWLS.cmd (startWLS.sh on UNIX), where WL_HOME is the location in which you installed WebLogic Server. The master startup script sets environment variables, such as the location of the JVM, and then starts the JVM with WebLogic Server arguments.
Creating Your Own Script to Start an Administration Server
If you use some other means to create a domain (such as the Administration Console), you can create your own startup script that does the following:
Variable for setting a cleartext user for server startup. Instead of using this variable, we recommend that you use a boot identity file. For more information, refer to Bypassing the Prompt for Username and Password. |
|
Variable for setting a cleartext password for server startup. Instead of using this variable, we recommend that you use a boot identity file. For more information, refer to Bypassing the Prompt for Username and Password. |
|
If you specify a URL for this variable, the server will start as a Managed Server and will use the specified URL to contact its Administration Server. For more information, refer to The Administration Server and Managed Servers. |
|
Determines whether the server runs in production mode or development mode. Specify true for production mode servers or false for development mode. For more information on using production and development modes refer to Development Mode vs. Production Mode. |
|
Java command-line options for running the server. The Java command-line options will be passed to the JVM after JAVA_VM and MEM_ARGS are passed. -Dweblogic.ListenAddress is an example of a Java option that you can call from the domain start script. For more information about command-line options, refer to Using the weblogic.Server Command. If you are listing multiple options in a UNIX shell, put quotes around the entire set of options and include spaces between each option. For example: JAVA_OPTIONS="-Dweblogic.attribute=value -Djava.attribute=value" |
|
Java argument that specifies the mode in which the virtual machine runs. Use one of the following options: If you are using a JVM that does not support any of these operational modes, you must edit the master script to prevent these arguments from being passed to the JVM. For more information, refer to Using a Non-Default JVM with WebLogic Server. |
|
Variable to override the default memory arguments passed to Java. In the master start scripts, the options are set by default to -Xms200m and -Xmx200m. |
The master startup script sets environment variables, such as the location of the JVM, and then starts the JVM with WebLogic Server arguments. If you are not using the JVM installed with WebLogic Server, you must edit the master start script. For more information, refer to Using a Non-Default JVM with WebLogic Server.
Using a Non-Default JVM with WebLogic Server
If you are not using the JVM installed with WebLogic Server, you must edit the master start script so that the JAVA_HOME variable specifies the correct location of the JVM on your system.
For detailed information, see "Using a Non-Bundled JVM With WebLogic Platform" at the following URL: http://download.oracle.com/docs/cd/E13196_01/platform/docs70/relnotes/relnotes.html.
Using the weblogic.Server Command
weblogic.Server is the command that starts a WebLogic Server on a local host. The startup scripts described in previous sections are wrappers that send a consistent set of options to this command. While we recommend that you incorporate this command and its options into a startup script, for simple invocations you can enter the weblogic.Server command directly on the command line.
For example, a simple invocation for starting the examples server on Windows is as follows (you must enter this command from the WL_HOME\samples\server\config\examples directory):
c:\bea\jdk131\bin\java
-hotspot -Xms200m -Xmx200m
-classpath "c:\bea\jdk131\lib\tools.jar;
c:\bea\weblogic700\server\lib\weblogic_sp.jar;
c:\bea\weblogic700\server\lib\weblogic.jar;"
-Dweblogic.Name=examplesServer
-Dbea.home="C:\bea" -Djava.security.policy="c:\bea\weblogic700\server\lib\weblogic.policy"
weblogic.Server
This section describes the following:
For information about starting a Managed Server on a remote host, refer to Managing Server Availability with Node Manager in the Creating and Configuring WebLogic Server Domains Guide.
The Java Virtual Machine (JVM) uses a setting called classpath to locate essential files and directories.
You can use the following command 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 a -classpath argument in the startup command. Regardless of the method you choose, include the following in the classpath for the JVM that runs your instances of WebLogic Server:
Depending on which WebLogic Server release, service pack, or patch that you have installed, this file might not exist on your system. Regardless of whether the file currently exists on your system, we recommend that you include WL_HOME/server/lib/weblogic_sp.jar on your classpath to ensure compatibility with any updates. You must add this file to the classpath before you add weblogic.jar.
Command Syntax for weblogic.Server
The syntax for the weblogic.Server command is as follows:
java RequiredArguments [OptionalArguments] weblogic.Server
The following table describes the required arguments for starting a WebLogic Server from the java command line.
Specify the minimum and maximum values (in megabytes) for Java heap memory. For example, you may 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. |
|
The minimum content for this option is described under Setting the Classpath. Note: This is optional if the classpath is set in the user environment. |
|
Server names must be unique within a domain. For example, if you name a server instance ManagedServer1 in a domain named DomainA, you cannot name another server instance ManagedServer1 in DomainA. |
|
Specifies the location of the BEA home directory, which contains licensing and other essential information. |
Frequently Used Optional Arguments
The following table describes optional arguments that are frequently used. The description of each argument indicates whether it can also be set through the Administration Console or some other WebLogic Server command. Any argument that sets an attribute for a Managed Bean (MBean) can also be set through the MBean's API. Other Optional Arguments, describes setting MBean attributes.
Specifies the server's root directory. For more information, refer to A Server's Root Directory. |
|
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 For information about config.dtd, refer to BEA WebLogic Server Configuration Reference. If you do not specify this value, the default is config.xml. |
|
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. This option prevents a server instance from using any boot identity file and overrides other startup options that cause a server to use boot identity files. For more information, refer to Bypassing the Prompt for Username and Password. |
|
This option prevents a server instance from using any boot identity file and overrides other startup options that cause a server to use boot identity files. For more information, refer to Bypassing the Prompt for Username and Password. |
|
Specifies a listen address for this server. The host value must be either the DNS name or the IP address of the server. This option sets the value of the listenAddress attribute in the ServerMBean, which is also accessible from the Administration Console under Server If you do not specify a Listen Address, a server uses either the machine's DNS name or the IP address. 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 Configuring Network Resources. |
|
Enables and specifies the plain-text (non-SSL) listen port for this server. The argument sets the value of the listenPort attribute in the ServerMBean, which is also accessible from the Administration Console under Server If you do not specify a Listen Port, a server uses 7001 as the default. For more information, refer to Configuring Network Resources. |
|
Enables and specifies the port at which this WebLogic Server listens for SSL connection requests. The argument sets the value of the listenPort attribute in the SSLMBean, which is also accessible from the Administration Console under Server If you do not specify a Listen Port, a server uses 7002 as the default. For more information, refer to Configuring Network Resources. |
|
Creates a boot.properties 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. For more information, refer to Bypassing the Prompt for Username and Password. |
|
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: 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. |
|
Specifies the password for retrieving Secure Socket Layer (SSL) private keys from an encrypted flat file. Use this option if you store private keys in an encrypted flat file. |
|
If you use SSL, 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 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. |
|
Disables host-name verification. Include this argument if you want to use the demonstration digital certificates that are shipped with WebLogic Server. Note: BEA does not recommend using the demonstration digital certificates or turning off host name verification in a production deployment. If you do not specify this argument, the Host Name Verifier in WebLogic Server compares the SubjectDN of a digital certificate with the host name of the server that initiated the SSL connection. If the SubjectDN and the host name do not match, the SSL connection is dropped. |
|
-Dweblogic.security.SSL. |
Specifies the name of a custom Host Name Verifier class. The class must implement the weblogic.security.SSL.HostnameVerifier interface. |
-Dweblogic.security.SSL. |
Modify the default server-session time-to-live for SSL session caching. The sessionCacheTimeToLive value specifies (in seconds) the session cache time-to-live. |
Enable the Java 2 security manager, which prevents untrusted code from performing actions that are restricted by the policy file. The -Djava.security.policy argument specifies a filename (using a relative or fully-qualified pathname) that contains Java 2 security policies. The WebLogic Server sample policy file, which you can edit and use, is 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. |
|
Enables support for the guest user account. If you start a WebLogic Server instance with this argument, you must also add the guest user to the Authentication provider in the default security realm. For more information, refer to Creating Users in the Securing WebLogic Resources guide. |
|
-Dweblogic.management.commo. |
As described in Recovering Failed Servers: Backing Up Security Data in the Creating and Configuring WebLogic Server Domains guide, security domain configuration information is stored in the domain_name/userConfig/Security directory. You can back up the data in a security domain or export the data to a new security domain using WebLogicMBeanLoader, which outputs an XML file. By default, the values of password attributes are not printed in clear text in the XML file but instead are masked as "*****". This avoids the security risk of printing passwords in clear text in the file system, but makes these files non-portable to different domains since the ***** mask strings cannot be intrepreted meaningfully. To make the XML file portable, you need to print clear text values to it, or else encrypted values that the new domain can decrypt. The value encrypted prints the attribute values in 3DES encrypted form. This should only be used when using the same Encryption salt in the new domain. The value cleartext prints the attribute values in clear text. Omitting this argument or using any other value obscures the attribute values, printing *****. |
Starts a server and places it in the STANDBY state. To use this startup argument, you must configure a server to use a separate administration port. For information about administration ports, refer to Configuring a Domain-Wide Administration Port in the Creating and Configuring WebLogic Server Domains Guide. This value overrides any startupMode value specified in the Administration Console under Server 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. |
|
Determines whether all servers in a domain start in production mode. This option is applicable only when starting the Administration Server. All Managed Servers start in the same mode as the Administration Server. 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 Development Mode vs. Production Mode. |
|
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 it 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 do not specify this option, the assumed value is true. |
|
Redirects the server and 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. For more information, refer to Redirecting System.out and System.err to a File. |
|
Redirects the server and 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. For more information, refer to Redirecting System.out and System.err to a File. |
|
-Dweblogic. |
Determines whether the Administration Server emits configuration auditing log messages when a user changes the configuration or invokes management operations on any resource within a domain. By default, the Administration Server does not emit configuration auditing messages. |
Used to override the default WebLogic Server HTTP stream handler. To use this option, write a class that implements the java.net.URLStreamHandlerFactory interface. In addition to implementing the createURLStreamHandler("http") method specified by the interface, the class must include a main() method that calls java.net.URL.setURLStreamHandlerFactory() with an instance of the class as its argument. Set this system property to the name of this class. For more information, see the javadocs for the java.net.URL.URLStreamHandlerFactory interface. |
You can use arguments of the weblogic.Server startup command to set attributes of the following MBeans:
You can set any attribute that the MBean exposes as a setter method. In the above syntax statements, attribute-name is the name of an MBean's setter method without the set prefix.
For example, the ServerMBean exposes its listen port attribute with the following setter method:
To set the listen port value from the weblogic.Server command, use the following syntax: -Dweblogic.ListenPort=portnumber
The command-line arguments override any settings currently in the MBean and they are not persisted to the domain's config.xml file.
Development Mode vs. Production Mode
You can run WebLogic Server in two different modes: development and production. You use development mode to test your applications. Once they are ready for a production environment, you deploy your applications on a server that is started in production mode.
Development mode enables a WebLogic Server to automatically deploy and update applications that are in the domain_name/applications directory (where domain_name is the name of a WebLogic Server domain).
Production mode disables the auto-deployment feature. Instead, you must use the WebLogic Server Administration Console or the weblogic.Deployer tool. For more information on deployment, refer to WebLogic Server Deployment in the Developing WebLogic Server Applications Guide.
By default, a WebLogic Server runs in development mode. To specify the mode for a server, do one of the following:
For more information about startWebLogic, refer to Starting an Administration Server Using a Script.
Note: Production or development mode is a domain-wide setting, which you specify when starting the Administration Server. All Managed Servers run in the same mode as the Administration Server.
Startup Arguments for the Administration Port and the weblogic.Admin Utility
An administration port is a separate port that you must set up if you want to start server instances in the STANDBY state or if you want to separate administration traffic from application traffic in your domain.
If you want to use an administration port to carry requests from the weblogic.Admin utility, you must do the following:
All instances of WebLogic Server use a root directory to store runtime data and to provide the context for any relative pathnames in the server's configuration.
In addition, an Administration Server uses its root directory as a repository for the domain's configuration data (such as config.xml) and security resources (such as the default, embedded LDAP server), while a Managed Server stores replicated administrative data in is root directory. (See Figure 2-2.)
Figure 2-2 Root Directory for WebLogic Server Instances
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. For example, if two servers share a directory and they both specify .\MyLogFile, then each server instance will overwrite the other's .\MyLogFile.
To determine the root directory for an Administration Server, WebLogic Server does the following:
To determine the root directory for a Managed Server, WebLogic Server does the following:
To make it easier to maintain your domain configurations and applications across upgrades of WebLogic Server software, it is recommended that the root directory not be the same as the installation directory for the WebLogic Server software.
Using the Default Configuration to Start a Server
If you run into problems in your environments and want to boot a server with a clean (default) configuration, you can start WebLogic Server in such a way that it generates a new config.xml file.
This new config.xml file contains only the default settings, unless you use command-line arguments to override the defaults. The username and password that you supply when you start the server becomes the default administrative user.
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.
To cause WebLogic Server to generate a new config.xml file, start an Administration Server using a server root directory that does not already contain a config.xml file. For example, you can do the following:
The server prompts you to reenter your password. Then it starts a server with the new configuration.
Before you can run a WebLogic Server as a Managed Server, you must do the following:
After describing how to add a Managed Server to a domain, this section describes starting a Managed Sever by completing any of the following tasks:
For information on starting Managed Servers when the Administration Server is unavailable, refer to Starting a Managed Server When the Administration Server Is Not Available in the Creating and Configuring WebLogic Server Domains Guide.
Adding a Managed Server to a Domain
To add a Managed Server to a domain, do the following:
Starting a Managed Server from the Windows Start Menu
If you use the Configuration Wizard to create a Managed Server (with owning Administration Server configuration) on a Windows computer, the wizard prompts you to install the domain in the Windows Start Menu. If you choose yes, then you can do the following to start the Managed Server:
From the Windows desktop, click Start
The Start Server command opens a command window and calls the domain_name\startManagedWebLogic.cmd script, which is described in Starting a Managed Server Using a Script. When the server has successfully completed its startup process, it writes the following message to the command window:
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Starting a Managed Server Using a Script
Because the arguments needed to start a WebLogic Server from the command line can be lengthy and prone to error, we recommend that you incorporate the command into a script.
This section describes the following tasks:
If you are not using the JVM installed with WebLogic Server, refer to Using a Non-Default JVM with WebLogic Server.
Using the Configuration Wizard Scripts to Start a Managed Server
When you use the Configuration Wizard to create a domain, the wizard creates a script that you can use to start a Managed Server:
Similar to the script for starting an Administration Server, startManagedWebLogic script sets values for some domain-specific variables. However, startManagedWebLogic also specifies the listen address of the domain's Administration Server, which causes the server to run as a Managed Server and retrieve its configuration from the Administration Server.
Before you use startManagedWebLogic, open the script in a text editor and make sure that the SERVER_NAME variable is set to the name of the WebLogic Managed Server that you wish to start. Also verify that the ADMIN_URL specifies the host (host name or IP address) and port number where the Administration Server is listening for requests (default is 7001). For example:
set SERVER_NAME=bigguy
set ADMIN_URL=peach:7001
Instead of opening and modifying startManagedWebLogic, you can enter either of the following commands:
For example, the following command uses startWebLogic.cmd to start a managed server named myManagedServer using the Administration Server named peach that listens on port 7001:
c:\user_domains\mydomain\startWebLogic.cmd myManagedServer http://peach:7001
For a complete description of the variables and Java options that can be specified in startManagedWebLogic, see Table 2-1 under Starting an Administration Server Using a Script.
For more information on configuring a connection to the Administration Server, refer to Configuring a Connection to the Administration Server.
When the server has successfully completed its startup process, it writes the following message to the command window:
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Creating Your Own Script to Start a Managed Server
If you use some other means to create a domain (such as the Administration Console), you can create your own startup script that starts a Managed Server in your domain. The steps for creating such a script are the same as the steps described in Creating Your Own Script to Start an Administration Server with the following addition:
You must set a value for a variable named ADMIN_URL. For information on configuring a connection to the Administration Server, refer to Configuring a Connection to the Administration Server.
When the server has successfully completed its startup process, it writes the following message to the command window:
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Starting a Managed Server from the Command Line
To start a WebLogic Managed Server from a command line, you use same command and arguments that you use for an Administration Server plus one of the following arguments, which configures a connection to the Administration Server:
For information on configuring a connection to the Administration Server, refer to Configuring a Connection to the Administration Server.
For information on the command and arguments for starting an Administration Server, refer to Using the weblogic.Server Command.
When the server has successfully completed its startup process, it writes the following message to the command window:
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Configuring a Connection to the Administration Server
Regardless of whether you start a Managed Server from the Windows Start menu, a script, or the weblogic.Server command, you must make sure that the Managed Server specifies the correct listen address of the Administration Server. A Managed Server uses this address to retrieve its configuration from the Administration Server.
Note: The first time you start a Managed Server, it must be able to contact the Administration Server. Thereafter you can configure Managed Servers to start even if the Administration Server is unavailable. For more information, refer to Starting a Managed Server When the Administration Server Is Not Available in the Creating and Configuring WebLogic Server Domains Guide.
You can express the listen address in one of the following formats:
where host is the name or IP address of the machine where the Administration Server is running and port is the Administration Server's default, non-SSL listen port. (By default the Administration Server's listen port is 7001.)
With this format, the Managed Server uses its default protocol (t3) to access the Administration Server. To modify the default protocol, do the following:
where host is the name or IP address of the machine where the Administration Server is running and port is the Administration Server's default, non-SSL listen port. (By default the Administration Server's listen port is 7001.)
To verify the host IP address, name, and default listen port of the Administration Server, start the Administration Server in a command shell. When the server successfully finishes its startup cycle, it prints to standard out messages that are similar to the following (among other messages):
<Apr 19, 2002 9:24:19 AM EDT> <Notice> <WebLogicServer> <000355> <Thread "Listen Thread.Default" listening on port 7001, ip address 11.12.13.141>
<Apr 19, 2002 9:24:19 AM EDT> <Notice> <WebLogicServer> <000331> <Started WebLogic Admin Server "myserver" for domain "mydomain" running in Development Mode>
You can change the IP address and listen port values from the Administration Console on a server's Configuration
If you have configured Secure Socket Layer (SSL) communication for the Managed Server and Administration Server, you can use this format. In this format, host is the name or IP address of the machine where the Administration Server is running and port is the Administration Server's SSL listen port.
If you set up the Administration Server to use an Administration Port, port must specify the Administration Port.
For information on enabling SSL, refer to Configuring the SSL Protocol in the Administration Console Online Help. For more information on Administration Ports, refer to Configuring a Domain-Wide Administration Port in the Creating and Configuring WebLogic Server Domains Guide.
Because the Managed Server receives its configuration from the Administration Server, the Administration Server specified must be in the same domain as the Managed Server.
Specifying the Default Startup State
To set up a server so that the weblogic.Server command (or a script that executes the command) starts it in STANDBY by default, do the following (starting a server in STANDBY requires you to set up an Administration Port for the server):
Starting a Remote Managed Server
If a Node Manager is running on the host machine of a Managed Server, you can start the Managed Server from a remote host using the Administration Console or the weblogic.Admin utility. Node Manager is a standalone Java program provided with WebLogic Server that enables you to start and stop remote Managed Servers.
For information about starting a remote server from the Administration Console, refer to Starting a Server and Starting a Server in the STANDBY State in the Administration Console Online Help.
For information on using the weblogic.Admin command utility, refer to START and STARTINSTANDBY.
For information about the Node Manager, refer to Managing Server Availability with Node Manager in the Creating and Configuring WebLogic Server Domains Guide.
Starting and Killing All WebLogic Servers in a Domain or Cluster
If the Node Manager is running on the host machines of your Managed Servers, you can use the Administration Console to start all of the Managed Servers in the domain or in a specific cluster. You cannot start the Administration Server from the Administration Console.
You can also use the Administration Console to force a shutdown (kill) of all WebLogic Servers in a domain or in a cluster. The kill command initiates a forced shutdown for Managed Servers and the Administration Server. It does not require the Node Manager.
This section describes the following tasks:
For information about the Node Manager, refer to Managing Server Availability with Node Manager in the Creating and Configuring WebLogic Server Domains Guide.
Starting All Managed Servers in a Domain
To start all of the Managed Servers in the active domain, do the following:
Starting All Managed Servers in a Cluster
To start all of the Managed Servers in a cluster, do the following:
Killing All Servers in a Domain
To initiate a force shutdown (kill) for all servers in a domain, do the following:
Killing All Servers in a Cluster
To initiate a force shutdown (kill) for servers in a cluster, do the following:
Shutting Down WebLogic Servers
You can do any of the following to shut down a WebLogic Server:
When you initiate a graceful shutdown, the server notifies subsystems to complete all in-work requests. After the subsystems complete their work, the server stops.
When you initiate a forced shutdown, the server instructs subsystems to immediately drop in-work requests. If you force a Managed Server to shut down and it fails to respond, and if you started the server with the Node Manager, the Node Manager kills the server process.
The server waits a number of seconds for all subsystems to successfully stop. After the number of seconds expires, the server does one of the following:
For information on changing the default number of seconds, refer to Setting the Timeout Period for LifeCycle Operations in the Administration Console Online Help.
Configuring Startup and Shutdown Classes
You can use startup and shutdown classes to configure a WebLogic Server to perform tasks when you start or gracefully shut down the server. A startup class is a Java program that is automatically loaded and executed when a WebLogic Server is started or restarted.
By default, startup classes are loaded and executed after all other server subsystems have initialized and after the server deploys modules. For any startup class, you can override the default and specify that the server loads and executes it before the server deploys JDBC connection pools, Web applications, and EJBs.
A shutdown class is a Java program that is automatically loaded and executed when the WebLogic Server is shut down either from the Administration Console or the weblogic.admin shutdown command. For more information about when a server invokes startup and shutdown classes, refer to The Server Lifecycle.
To use startup or shutdown classes, you must configure and assign these classes to one or more servers. To configure a class from the Administration Console, refer to Startup and Shutdown Classes in the Administration Console Online Help. BEA provides the examples.jms.startup API code example which demonstrates how to establish a JMS message consumer from a WebLogic startup class.
Note: WebLogic Server 7.0 optionally installs API code examples in WL_HOME\samples\server\src\examples, where WL_HOME is the top-level directory of your WebLogic Server installation. You can start the examples server, and obtain information about the samples and how to run them.
Setting Up a WebLogic Server Instance as a Windows Service
If you want a WebLogic Server instance to start automatically when you boot a Windows host computer, you can set up the server as a Windows service.
For each server instance that you set up as a Windows service, WebLogic Server creates a key in the Windows Registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. The registry entry contains such information as the name of the server and other startup arguments.
When you start the Windows host, the Windows Service Control Manager (SCM), which is part of the Windows operating system, uses the information in the Windows Registry key to invoke the weblogic.Server main class. The Windows SCM cannot be configured to use a Node Manager to start Managed Servers, and therefore the Node Manager's monitoring and automatic restart features cannot be used for servers that run as a Windows service.
The following tasks set up and manage WebLogic Server instances that run as Windows Services:
Setting Up a Windows Service: Main Steps
Some of the domain templates in the Domain Configuration Wizard prompt you to set up a server as a Windows service. If you choose Yes, the wizard installs the server as a Windows service. If you are using the wizard to create an Administration Server and Managed Servers, the wizard creates a Windows service only for the Administration Server. The wizard also creates a server-specific script for you that you can modify and use to install other servers as Windows services. The script is named domain-name\installService.cmd, where domain-name is the name of the domain that you created.
Create a Server-Specific Script
If the Domain Configuration Wizard did not already create a server-specific script for your domain, you can create one. The script sets values for variables that identify the name of the server instance and other server-specific information. Then the script calls a master script, WL_HOME\server\bin\installSvc.cmd, where WL_HOME is the directory in which you installed WebLogic Server. The master scripts invokes the beasvc utility, which adds a key to the Windows Registry.
Note: For more information about beasvc, enter the following command at a command prompt: WL_HOME\server\bin\beasvc -help, where WL_HOME is the directory in which you installed WebLogic Server.
To see an example of a server-specific script, refer to Listing 2-1.
To create a server-specific script:
where absolute-pathname is the absolute pathname of the Administration Server's root directory (the directory that contains the domain's configuration file). For more information about the root directories for servers, refer to A Server's Root Directory.
where username is the name of an existing user with privileges to start a server instance and password is the user's password. The beasvc utility encrypts the login credentials and stores them in the Windows registry.
This is one of two possible methods for avoiding the username/password prompt when a server instance starts. The disadvantage to this method is that changing the username or password for the server instance requires you to delete the Windows service and set up a new one with the new username and password. Instead of this method, you can use a boot identity file. With a boot identity file, you can change the login credentials without needing to modify the Windows service. For more information, refer to Bypassing the Prompt for Username and Password.
When the STARTMODE variable is set to true, the server instance starts in production mode. When not specified, or when set to false, the server starts in development mode. For more information about development mode and production mode, refer to Development Mode vs. Production Mode.
where java-options is one or more Java arguments that you want to pass to the Java Virtual Machine (JVM). Separate multiple arguments with a space. For a list of Java options that are specific to WebLogic Server, refer to Command Syntax for weblogic.Server. The JVM that you use supports additional options and are documented by the JVM vendor.
where JVM-mode is a text string that indicates the mode in which you want the JVM to run. The values that you supply depend on the JVM that you are using. If you use the JRockit JVM, the default value is -jrockit. For more information, refer to "Starting and Configuring the JRockit JVM" in the JRockit User Guide.
To see a list of supported JVMs, refer to the List of Supported Platforms at the following URL: http://download.oracle.com/docs/cd/E13222_01/wls/certifications/certs_700/overview.html.
Set Additional Values for Managed Servers
If you want to install a Managed Server as a Windows service, you must include a variable that specifies the location of the domain's Administration Server. The Managed Server must contact the Administration Server to retrieve its configuration data.
To set additional values for Managed Servers:
For more information, refer to Configuring a Connection to the Administration Server.
For an example, refer to the bold text in Listing 2-1.
Listing 2-1 Example Script for Setting Up a Server as a Windows Service
echo off
SETLOCAL
set DOMAIN_NAME=myWLSdomain
set USERDOMAIN_HOME=d:\bea\user_projects\myWLSdomain
set SERVER_NAME=myWLSserver
set STARTMODE=true
set JAVA_OPTIONS=-Dweblogic.Stdout="d:\bea\user_projects\myWLSdomain\stdout.txt" -Dweblogic.Stderr="d:\bea\user_projects\myWLSdomain\stderr.txt"
set ADMIN_URL=http://adminserver:7501
set MEM_ARGS=-Xms40m -Xmx250m
call "d:\bea\weblogic700\server\bin\installSvc.cmd"
ENDLOCAL
Require Managed Servers to Start After Administration Servers
If you set up both an Administration Server and a Managed Server to run as Windows services on the same computer, you can specify that the Managed Server starts only after the Administration Server.
To require a Managed Server to start after the Administration Server Windows service, do the following:
The modified beasvc invocation for the Administration Server will resemble the following:
"%WL_HOME%\server\bin\beasvc" -install
-svcname:"%DOMAIN_NAME%_%SERVER_NAME%"
-delay:120000
-javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%"
-extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%"
-cmdline:%CMDLINE%
For more information about beasvc, enter the following command at a command prompt: WL_HOME\server\bin\beasvc -help, where WL_HOME is the directory in which you installed WebLogic Server.
For example, the modified beasvc invocation for the Managed Server will resemble the following:
"%WL_HOME%\server\bin\beasvc" -install
-svcname:"%DOMAIN_NAME%_%SERVER_NAME%"
-depend:"myDomain_myAdminServer"
-javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%"
-extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%"
-cmdline:%CMDLINE%
You can also add the -delay:delay_milliseconds option to a Managed Server Windows service if you want to configure when the Windows SCM reports a status of STARTED for the service.
Enable Graceful Shutdowns from the Control Panel
By default, if you use the Windows Control Panel to stop a server instance, the Windows Service Control Manager (SCM) kills the server's Java Virtual Machine (JVM). If you kill the JVM, the server immediately stops all processing. Any session data is lost. If you kill the JVM for an Administration Server while the server is writing to the config.xml file, you can corrupt the config.xml file.
To enable graceful shutdowns from the Windows Control Panel, do the following:
This method gracefully shuts down a server after the server has completed all inflight work. For an example of such a class, refer to Java Class that Shuts Down a Server Instance.
For example, if you packaged the class in Java Class that Shuts Down a Server Instance in com.myClasses, the modified beasvc command will be as follows:
the modified beasvc invocation will resemble the following:
"%WL_HOME%\server\bin\beasvc" -install
-svcname:"%DOMAIN_NAME%_%SERVER_NAME%"
-stopclass:com.myClasses.ServerStopper
-javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%"
-extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%"
-cmdline:%CMDLINE%
For more information about beasvc, enter the following command at a command prompt: WL_HOME\server\bin\beasvc -help, where WL_HOME is the directory in which you installed WebLogic Server.
By default, when you use the Windows 2000 Control Panel to stop a Windows service, the Windows SCM waits 30 seconds for the service to stop before it kills the service and prints a timeout message to the System event log.
If you use -stopclass to gracefully shut down a server, 30 seconds might not be enough time for the server to gracefully end its processing.
To configure a timeout period on Windows 2000, create a REG_DWORD registry value named ServicesPipeTimeout under the following registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control
The key value must be in milliseconds.
This value is read from the registry during the startup of the Windows operating system and it affects all services that are installed.
Java Class that Shuts Down a Server Instance
The following Java class uses Java Management Extensions (JMX) to shut down a server instance. Each server uses JMX Managed Beans (MBeans) to expose its management attributes and operations. One such MBean, ServerRuntime, exposes a shutdown() method that gracefully shuts down a server.
The class in Listing 2-2 uses the Administration MBeanHome interface, which can retrieve and call ServerRuntime MBean operations for all server instances in a domain.
For more information about JMX programming, refer to the Programming WebLogic Management Services with JMX guide.
Listing 2-2 Java Class that Shuts Down a Server Instance
import java.util.Set;
import java.util.Iterator;
import java.rmi.RemoteException;
import javax.naming.*;
import weblogic.jndi.Environment;
import weblogic.management.MBeanHome;
import javax.management.ObjectName;
import weblogic.management.WebLogicMBean;
import weblogic.management.configuration.ServerMBean;
import weblogic.management.runtime.ServerRuntimeMBean;
import weblogic.management.WebLogicObjectName;
public class ServerStopper {
public static void stop() throws Exception {
MBeanHome home = null;
//url of the Admin server
String url = "t3://qa113:7001";
String username = "system";
String password = "gumby1234";
ServerRuntimeMBean serverRuntime = null;
Set mbeanSet = null;
Iterator mbeanIterator = null;
try {
// Set ContextClassloader to prevent assertions
URL[] urls = { new File("/").toURL() };
Thread.currentThread().setContextClassLoader(new
URLClassLoader(urls));
Environment env = new Environment();
env.setProviderUrl(url);
env.setSecurityPrincipal(username);
env.setSecurityCredentials(password);
Context ctx = env.getInitialContext();
home = (MBeanHome)
ctx.lookup("weblogic.management.adminhome");
mbeanSet = home.getMBeansByType("ServerRuntime");
mbeanIterator = mbeanSet.iterator();
while(mbeanIterator.hasNext()) {
serverRuntime = (ServerRuntimeMBean)mbeanIterator.next();
if(serverRuntime.getState().equals("RUNNING")) {
serverRuntime.shutdown();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Redirecting Standard Out and Standard Error to a File
By default, when you install a WebLogic Server instance as a Windows service, you cannot see the messages that the server or its JVM print to standard out and standard error.
To view these messages, you must redirect standard out and standard error to a file:
-log:"pathname "
where pathname is a fully qualified path and filename of the file that you want to store the server's standard out and standard error messages.
The modified beasvc command will resemble the following command:
"%WL_HOME%\server\bin\beasvc" -install
-svcname:"%DOMAIN_NAME%_%SERVER_NAME%"
-javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%"
-extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%"
-cmdline:%CMDLINE%
-log:"d:\bea\user_projects\myWLSdomain\myWLSserver-stdout.txt
After you install the service and restart the Windows host, to view the messages that the server writes to standard out or standard error, do one of the following:
Printing Thread Dumps to Standard Out
To cause the WebLogic Server instance to print a thread dump to standard out, do either of the following:
For example:
D:\bea\weblogic70\server\bin\beasvc -dump -svcname:mydomain_myserver
Adding Classes to the Classpath
The classpath is a declaration of the location of Java classes that a JVM can invoke. When you use the WebLogic Server master script to install a server instance as a Windows service, the master script specifies all classes required to run a server instance. If you want to extend WebLogic Server by adding your own Java classes, you must add them to the classpath.
To add classes to the classpath:
For example if you archived your class in a file named c:\myJar, the modified statement will be as follows:
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar;c:\myJar;%CLASSPATH%
Note: Win32 systems have a 2K limitation on the length of the command line. If the classpath setting for the Windows service startup is very long, the 2K limitation could be exceeded.
-classpath @filename
where filename is the name of the file that contains the classpath values.
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
-classpath @myClasspath.txt -Dweblogic.Name=%SERVER_NAME% -Dbea.home=\"D:\bea_70sp2\" -Dweblogic.management.username=%WLS_USER% -Dweblogic.management.server=\"%ADMIN_URL%\" -Dweblogic.ProductionModeEnabled=%STARTMODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"
Run the Server-Specific Script
Note: To run the server-specific script, you must log in to the Windows computer with a user account that has privileges to modify the Windows registry.
If you install the Windows service in a production environment, BEA recommends that you do not run the service under an operating-system user account that has administrator-level privileges. For more information, see Verifying the User Account Under Which the Service Runs.
To run the server-specific script:
The command prompt runs the script as a batch file.
If the script runs successfully, it creates a Windows service named
DOMAIN_NAME_SERVER_NAME and prints a line to standard out that is similar to the following:
mydomain_myserver installed.
By default, standard out is the command prompt in which you run the server-specific batch file.
To verify that you successfully set up a WebLogic Server as a Windows service, do the following:
If your setup was successful, the beasvc -debug command starts your server. If the script returns an error similar to the following, make sure that you specified the correct service name:
Unable to open Registry Key ....... System\CurrentControlSet\Services\beasvc example_examplesServer\Parameters
Verifying the User Account Under Which the Service Runs
In a production environment, WebLogic Server Windows services should run under a special operating-system user account that has limited access privileges. For example, the OS user should have access privileges only to BEA files and to your domain files. This should be the only user account that has access to these files.
To ensure that the WebLogic Server instance runs under the special OS user account:
Using the Control Panel to Stop or Restart a Server Instance
After you set up a server instance to run as a Windows service, you can use the Service Control Panel to stop and restart the server.
By default, if you use the Windows Control Panel to stop a server instance, the Windows Service Control Manager (SCM) kills the server's Java Virtual Machine (JVM). If you kill the JVM, the server immediately stops all processing. Any session data is lost. If you kill the JVM for an Administration Server while the server is writing to the config.xml file, you can corrupt the config.xml file. For information on enabling graceful shutdowns from the Windows Control Panel, refer to Enable Graceful Shutdowns from the Control Panel.
To stop or restart a WebLogic Server instance that is installed as a Windows service:
Removing a Server as a Windows Service
To remove a Windows service that runs a WebLogic Server instance, you can use a script that causes the beasvc utility to remove the associated key from the Windows Registry. Removing the Windows service has no effect on the server instance's configuration that is saved in the domain's configuration file. After you remove the Windows service, you can start the WebLogic Server instance with start scripts or, for Managed Servers, the Node Manager.
If the Domain Configuration Wizard did not already create a script for your domain, you can create one. The script sets values for variables that identify the name of the server instance and other server-specific information. Then the script calls a master uninstall script, WL_HOME\server\bin\uninstallSvc.cmd, where WL_HOME is the directory in which you installed WebLogic Server. The master scripts invokes the beasvc utility, which removes a key from the Windows Registry.
To see an example of a server-specific uninstaller script, refer to Listing 2-3.
To create a script for removing a Windows service that runs a WebLogic Server instance:
If the removal script runs successfully, it prints a line similar to the following to standard out:
mydomain_myserver removed.
By default, standard out is the command prompt in which you run the batch file.
Listing 2-3 Script to Remove a Windows Service
echo off
SETLOCAL
set DOMAIN_NAME=myWLSdomain
set SERVER_NAME=myWLSserver
call "D:\bea\weblogic700\server\bin\uninstallSvc.cmd"
ENDLOCAL
Changing Startup Credentials for a Server Set Up as a Windows Service
To change a Windows service so that a WebLogic Server instance runs under different user credentials, do one of the following:
The command prompt runs the script as a batch file.
If the script runs successfully, it creates a Windows service named
DOMAIN_NAME_SERVER_NAME and prints a line to standard out that is similar to the following:
mydomain_myserver installed.
By default, standard out is the command prompt in which you run the server-specific batch file.
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |