[ Team LiB ] Previous Section Next Section

Starting and Stopping WebLogic Server 8

Starting your WebLogic Server 8 is done differently depending on the type of server you want to start (administrative or managed). Let's look at two configurations: the typical WebLogic installation with the Examples Server (Admin server only) and a custom domain installation that contains two managed servers. (Note: Before starting the server using either method, ensure that your system CLASSPATH variable is scrubbed.)

Starting the WebLogic 8 Admin Server

Regardless of your configuration, the Admin server must be started first.

In Windows, there are two ways in which to start the Examples Server: the Start menu and command script (which is generated as part of the WebLogic 8 installation).

To start the Examples Server from the Windows Start menu, choose the sequence Start→BEA WebLogic Platform 8.1→Examples→WebLogic Server Examples→Launch Server Examples. This sequence is shown in Figure 2.22.

Figure 2.22. Starting the Examples Server from the Start menu.

graphics/02fig22.gif

CAUTION

When starting WebLogic Server, if the username and password weren't provided during installation, you will be prompted to enter them during the server start routine.


To start the Examples Server on Windows using the command script provided with your installation, open a DOS/command prompt window and navigate to the directory containing the file startExamplesServer.cmd. This should be the directory BEAHome\WebLogicHOME\samples\domains\examples. Execute the script as shown in Figure 2.23.

Figure 2.23. Starting the Examples Server from the command prompt.

graphics/02fig23.jpg

When starting the WebLogic Examples Server, three applications are activated: your default Web browser, the PointBase database, and WebLogic Server. The default Web browser is initiated on a successful start of WebLogic Server.

The browser will open to the index page within the samples application. This index is a WebLogic Server Examples welcome page, which contains a link to the WebLogic Admin Console. The WebLogic console, which is discussed later within this book, enables you to administer your WebLogic domains.

The WebLogic Platform installation provides the PointBase database to use with your WebLogic Server examples. The PointBase database is a lightweight relational database suitable for evaluation or developmental use. A console window to the PointBase application will pop up. For details about the PointBase product, refer to the BEA documentation site at http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/howdoi/howAdministerTheDefaultPointbaseDatabase.html. Additional documentation is available on the PointBase Web site at http://www.pointbase.com/node.shtml?navHier=Support/Product+Docs&CF=support/docs/overview.html.

WebLogic Server will activate a command prompt window (for Windows) or command-line output (for Unix—you may choose to redirect this output to a file and “tail” that file), which will display a series of server messages. Figure 2.23 displays the end text of a successful server start process. If you encounter problems with WebLogic Server, investigate this output along with the associated server log file, which is found under the domain's directory (in our example, e:\bea\weblogic81\samples\domains\examples\examples.log).

To start WebLogic Server on a Unix system, navigate to the directory containing the start script provided by your install: the file startExamplesServer.sh. This should be in the directory BEAHome\WebLogicHOME\samples\domains\examples. Ensure you've set execute permission on this script, and execute it as shown:


$ ./startExamplesServer.sh

Both start scripts (Windows and Unix versions) set environment variables and pass parameters to the Java class weblogic.Server, which configures a JVM suitable for the server and starts it. See the “Creating Your Own Start Scripts” section presented later in this chapter. You can also inspect the provided scripts on specific parameters used to start your server or refer to the BEA documentation on specific server start parameters at http://e-docs.bea.com/wls/docs81/admin_ref/weblogicServer.html.

Starting WebLogic 8 Managed Servers

Before starting a managed server, the associated parent Admin server must be started as detailed earlier. In our example, we have an Admin server containing two managed servers.

There are two general ways in which to start a managed server: the WebLogic 8 console and command scripts. The weblogic.Server command implemented within scripts may be manually executed on the command line, as mentioned earlier.

First, the Admin server must be running as previously detailed. To start the managed server after your Admin server is started, enter the Administration Console at http://yourURL:port/console. (Note that console is case-sensitive; that is, Console will not work.) After entering a username and password, start the specific managed server using the sequence yourDomain→Servers→server#→Control (TAB)→Start This Server as shown in Figure 2.24.

Figure 2.24. Starting a domain-managed server from the WebLogic Console.

graphics/02fig24.jpg

NOTE

The Administration Console is a browser-based tool used to manage your WebLogic Server configurations. Details about the use of the console occur throughout this book.


NOTE

The WebLogic Server default setting for URL:port is 127.0.0.1:7001, yielding an address of http://localhost:7001/console.


To start managed servers using command scripts after successfully initiating your Admin server, open a DOS/Command Prompt window and navigate to the directory containing the file startManagedWebLogic.cmd. This should be the directory \\user_project_location\yourDomain. Execute the script, passing the managed server's name and the Admin server's URL; for our example, that's startManagedWeblogic server1 http://127.0.0.1:7001, as shown in Figure 2.25. Note the command given on the first line.

Figure 2.25. Starting a domain-managed server using a command script.

graphics/02fig25.gif

On Unix, navigate to the directory containing the file startManagedWebLogic.sh. This should be the directory BEAHome/user_project_location/yourDomain. Ensure you've set execute permission and execute the script as shown:


$ ./startManagedWebLogic.sh server# admminServerURL:port

Successful Start Messages

All successful server start operations should display the WebLogic 8 standard output messages, indicating the type of server (admin or managed), IP address, port number, and server status (running) as shown here:



<Apr 20, 2003 5:07:47 PM PDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed
graphics/ccc.gif to RUNNING>
<Apr 20, 2003 5:07:47 PM PDT> <Notice> <WebLogicServer> <BEA-000360> <Server started in
graphics/ccc.gif RUNNING mode>

An example of the actual server window text is shown in Figure 2.23.

CAUTION

All errors reported in the server window (and associate server log)—especially errors involving RMI services on your Admin servers—should be corrected before continuing.


Graceful Termination of WebLogic Server 8

There are two means in which to terminate WebLogic Server gracefully: by using the Administration Console and by executing the weblogic.Admin utility. The Administration Console and the weblogic.Admin utility enable you to conduct graceful and forced shutdowns of WebLogic Server. A graceful shutdown allows all processes (including outstanding requests) to complete before the server initiates shutdown routines. A forced shutdown immediately terminates all server processes (dropping outstanding requests).

Terminating WebLogic Server 8 Using the Administration Console

Using your Administration Console, you can conduct either a graceful or a forced shutdown of the WebLogic Server 8 series. To shut down a server, enter your Admin server's console at http://yourURL:port/console. At the prompt screen, enter your username and password, and navigate to the specific server using the sequence yourDomain→Servers→server#→Control (TAB)→Shutdown This Server# (or Forced Shutdown of this Server#), as shown in Figure 2.24 earlier.

Terminating WebLogic Server 8 Using the weblogic.Admin Utility

The weblogic.Admin utility is a Java application that's included in your WebLogic 8 installation. Using this utility, you can conduct either a graceful or a forced shutdown of the WebLogic Server 8. To shut down a server using this utility, execute the Java application, passing the administration server URL (including port number), username, password, SHUTDOWN (or FORCESHUTDOWN) keyword, and name of server targeted for termination, as shown:



java webLogic.Admin -url http://127.0.0.1:7001 -username system -password weblogic
graphics/ccc.gif SHUTDOWN server1

or



java webLogic.Admin -url http://127.0.0.1:7001 -username system -password weblogic
graphics/ccc.gif FORCESHUTDOWN server1

The previous commands shuts down managed server1, controlled by an administration server located at http://127.0.0.1:7001.

Ungraceful Termination of WebLogic Server 8

Ungraceful termination of WebLogic Server entails terminating the process. On a Unix system, merely find the server's process ID (ps -ef | grep java) and issue the kill command: kill -PID. On a Windows system, terminate the Windows process or merely kill the server's execution window. Obviously, no shutdown routines or classes will execute using this method.

    [ Team LiB ] Previous Section Next Section