BEA Logo BEA WebLogic Server Release 1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

   Installing and Setting Up WebLogic Server 4.5:   Previous topic   |   Next topic   |   Contents   

 

Setting up and Starting WebLogic Server 4.5

 

This section guides you through setting up your computer to run a single WebLogic Server. The steps listed here will prepare your computer to run WebLogic Server in a minimal, basic configuration. As you begin developing and deploying applications using WebLogic Server, you will define additional properties that set up the WebLogic services or Application Program Interfaces (API) that you use in your code. Additional information is available in the WebLogic Server Developers Guides for each API.

There are several ways you can start WebLogic Server. Window NT users can start WebLogic Server immediately after running the Install Shield by using the Windows Start Menu. The InstallShield distribution also allows Windows users to use Windows Convenience Programs to start WebLogic Server.

Additional ways of starting WebLogic Server, including Starting WebLogic Server from the command line, and Starting WebLogic Server using scripts are also described in this document. Follow the tasks listed below to correctly set your environment before using the command line or scripts to start WebLogic Server.

For information on setting up a WebLogic Cluster, please see Setting up a WebLogic Cluster, in the WebLogic Server documentation.

Tasks to set up and start WebLogic Server

  1. Install a JDK

  2. Setting the environment

    Setting the system PATH
    Setting the classpath
    Setting up the Java security manager for Java 2
    Installing a WebLogic license

  3. Starting WebLogic Server

    Starting WebLogic Server from the command line
    Starting WebLogic Server from the WebLogic Console
    Starting WebLogic Server using scripts

    Starting WebLogic Server on Windows NT

    Start Menu
    NT Service
    Windows Convenience Programs ( see page 31)
    Starting WebLogic Server from the command line

  4. Next steps

Install a JDK

WebLogic Server requires that you have a Java Development Kit (JDK) installed on your computer. A JDK provides a Java runtime environment and tools for compiling and debugging your Java applications. There are versions of the JDK for Windows NT and Solaris available free from JavaSoft and SunSoft. JDKs for other platforms are available from the platforms' manufacturers.

These Java environments are constantly under revision and are frequently updated with new releases and bug fixes. For more information on the latest JDKs supported for running WebLogic Server, check the WebLogic Platform support page.

Setting the environment

If you installed WebLogic Server on Windows NT using InstallShield, a Java Runtime Environment (JRE) is automatically installed and configured to run WebLogic Server. A JRE provides only a runtime environment, and does not include development tools such as compilers and debuggers. Many Java applications developed for deployment with WebLogic Server require that a compiler be available while an application is running. For these applications, you will need to install a JDK.

If you wish to run WebLogic Server from the command line or with scripts, follow the procedures in this section to set up your system PATH, Java system classpath, WebLogic classpath, weblogic.properties file, weblogic.policy file, and licenses.

Setting the system PATH

Set your system PATH to include the java\bin directory of your JDK and the weblogic\bin directory. If you are using any of the WebLogic type 2 jdbcKona drivers, you must also include the path to the client libraries for your driver. See Installing JDBC Drivers for more information. On Windows NT, you would use the following command to set your path in a command window:

$set path=c:\java\bin;c:\weblogic\bin;%path%

Where java is the directory containing your JDK and weblogic is the directory containing your WebLogic Server installation.

Setting the classpath

In the Java environment, the Java virtual machine uses the classpath to locate the classes it needs to run an application. Setting your classpath correctly is essential for running WebLogic Server or any Java application. WebLogic Server uses a process called dynamic class loading and therefore requires a combination of two settings for classpath:

Although it is common practice for Java users to set the Java system classpath with the CLASSPATH environment variable, BEA recommends, when starting WebLogic Server, that you set your Java system classpath from the command line, using the -classpath option of the java command, which overrides any environment CLASSPATH setting. Using this procedure ensures that only the correct classes are loaded and that conflicting classes are not loaded.

These instructions apply only to running WebLogic Server. If you will be running any WebLogic examples, Java utilities, WebLogic clients, or other Java applications, you will need to set the classpath appropriately for those applications. For more information see Setting classpath. You can also find instructions for setting the classpath in the documentation for the examples and utilities.

Upgrading from a previous release

If you are upgrading from an earlier release of WebLogic Server, you should pay special attention to classpath issues because the requirements have changed. WebLogic Server now uses a new class loader to load classes. The new class loader requires that you specify the classpath differently and also requires you to update any scripts or shortcuts you use to run WebLogic Server.

If you have Enterprise Java Beans compiled under an earlier release, you must recompile them for use with this release.

If you have any user-written or third party server-side classes, copy them to:

c:\weblogic\myserver\serverclasses

If you have any user-written or third party client-side classes, copy them to

c:\weblogic\myserver\clientclasses

Where c:\weblogic is the path to the directory where you installed WebLogic Server.

What to put in your Java system classpath

The following must be included as arguments to the -classpath option on the java command line:

What to put in your WebLogic classpath

The following must be included as values for the -Dweblogic.class.path property. These classes will be loaded using the dynamic class loader:

Microsoft SDK for Java (JView

The command line syntax for jview is different from the java command. To run WebLogic Server under jview, make the following substitutions:

Note that jview does not support the new class loader used by WebLogic Server. A WebLogic Server started under jview will not be able to use the class loader to load classes from the WebLogic classpath (the classes normally specified with the weblogic.class.path property). Since the class loader is not used, you will not be able to use the Hot Deploy feature for deploying EJBs or servlets in a running WebLogic Server without having to restart the server.

To run WebLogic Server under jview, do not specify the weblogic.class.path property on the command line. Instead, specify those classes that would otherwise go in the WebLogic classpath in the Java system classpath, (along with the classes which normally belong in the Java system classpath). The classes must be specified in the order shown in the following example:

 $jview /cp c:\weblogic\classes\boot;
c:\weblogic\classes;
c:\weblogic\license;
c:\weblogic\lib\weblogicaux.jar;
c:\weblogic\myserver\serverclasses weblogic.Server

Where c:\weblogic is the path to the directory where you installed WebLogic

If you did not install WebLogic Server from the InstallShield, (that is, you used the zip archive) you must also install a JDK from JavaSoft and append the classes.zip file to the end of your Java system classpath. (Add c:\java\lib\classes.zip to the /cp option, where c:\java is the path to your JDK directory.)

If you are using WebLogic COM, also set your trusted classpath. See Using WebLogic COMfor more information.

The WebLogic Frequently Asked Questions also has a section on jview.

Cloudscape DBMS

WebLogic Server comes with a trial version of an all-Java database management system (DBMS) called Cloudscape. The WebLogic Tour and some of the example code shipped with WebLogic Server use this DBMS. You can also use it for testing if you do not have another DBMS available. If you will be using Cloudscape, you must include it in your Java system classpath. Normally third-party classes such as these should be included in the WebLogic classpath (with the weblogic.class.path property). However, due to some differences in the Cloudscape product, this jar file should be included in the Java system classpath (using the -classpath option). For additional information, see Using the Cloudscape database with WebLogic.

Setting up the Java security manager for Java 2

When you run WebLogic Server under Java 2 (JDK 1.2.x), the server uses a Java Security Manager to control access to system resources. Java Security Manager requires a security policy file to set up the permissions. The WebLogic distribution contains a security policy file (called weblogic.policy) that contains a set of default permissions that allows you to start WebLogic Server without creating your own security policy.

Modifying the weblogic.policy file for general use

Windows NT InstallShield users may skip the remainder of this section. InstallShield modifies the weblogic.policy file automatically.

To modify the weblogic.policy file included with your distribution:

  1. Edit the following two lines in the weblogic.policy file, changing the items in bold to match the location of the directory where you installed WebLogic Server:

    grant codeBase "file:/c:/weblogic/-" {

    permission java.io.FilePermission "c:${/}weblogic${/}-", ...

  2. Set these two properties on the Java command line when you start WebLogic Server:

Modifying the weblogic.policy file for third party or user-written classes

The best location for your server-side user code is the weblogic/myserver/serverclasses directory. If you have third party or user-written classes that are not in that directory, also:

  1. Copy the entire block of code in the weblogic.policy file from "grant codebase ..." to the closing bracket and semicolon.

  2. Paste the selection back into the weblogic.policy file below the section you just copied.

  3. Edit the grant codeBase and the permission java.io.FilePermission statements so that the directories point to the location of your third party or user-written code.

    This procedure creates a security policy for your code that contains exactly the same permissions as those for the WebLogic Server. You should examine these permissions closely to make sure that this is the security policy you want to use for those directories. For more information on setting up a security policy, see the article Default Policy Implementation and Policy File Syntax on the JavaSoft website.

    Caution: Using JavaSoft JDK version 1.2.1 on UNIX systems applies security policy improperly if your WebLogic software is not installed in the root directory of the file system or disk drive. Policy is only applied correctly if the path in a grant codeBase URL has just one component. For example, if you install WebLogic Server in c:\test\weblogic, (or even /home/weblogic on Solaris), you will see AccessControlExceptions even though you use the correct URL in your policy file.

    To work around this limitation, you can either install WebLogic in the root directory (recommended) or modify the URL so that it contains only the first component of the path to your WebLogic installation, for example:

    grant codeBase "file:/c:/test/-" {

    This problem has been acknowledged by Sun Microsystems as bug # 4261298.

Installing a WebLogic license

Your WebLogic distribution requires a valid license to run. This section tells you how to install and update WebLogic licenses.

Evaluation licenses

An evaluation copy of WebLogic Server is enabled for 30 days so you can start using WebLogic Server immediately. To use WebLogic Server beyond the 30-day evaluation period or to use clustering features, you will need to contact your salesperson about further evaluation or purchasing a license for each IP address on which you intend to use WebLogic Server. All WebLogic Server evaluation products are licensed for use on a single server with access allowed from up to 3 unique client IP addresses.

If you downloaded WebLogic Server from the BEA website, your evaluation license is included with the distribution. InstallShield users will also receive a password by email. The InstallShield program will prompt you for this password during the installation process.

If you obtained WebLogic Server from an evaluation CD, follow the instructions on the CD for obtaining an evaluation license.

Other licenses

When you purchase a license for WebLogic Server you will receive a set of license keys by email. To use these keys, follow the instructions below, under Updating a license.

Updating a license

You need to add new keys to your existing license file if you have purchased more software, if you have applied for and received an extension to your 30-day evaluation, or if you get a new distribution that includes new products. You will receive a set of permanent, non-expiring license keys by email as an attachment after purchase. If you are evaluating WebLogic Server's clustering feature, you may receive a set of evaluation keys for clustering.

To add new license keys to your existing license file:

  1. Open the message containing the keys you received by email when you purchased a license from BEA Systems, Inc.

  2. Open the WebLogicLicense.xml file in a text editor. (Make sure you don't edit this file in Microsoft Word, or any other word-processing program that will save the file as a binary.)

  3. Copy the keys from the email and paste them at the top of the XML file, after the <WEBLOGIC-LICENSES> tag.

    For example, a key for clustering looks something like this:

    <WEBLOGIC-LICENSES>

    <LICENSE PRODUCT="WebLogic/ClusterII"
    IP="000.000.900.900"
    UNITS="5"
    EXPIRATION="31-Mar-1999"
    KEY="w20f8s08480v0adpup3485paprtnp8ac"
    />

    ... </WEBLOGIC-LICENSES>

  4. Save the WebLogicLicense.xml file into your WebLogic license directory. If you have installed with defaults, that will be /weblogic/license.

  5. Save your license key information and a copy of your WebLogicLicense.xml file in a safe place outside the WebLogic distribution. Although no one else will be able to use your license keys, you should probably save this information in a place protected from either malicious or innocent tampering by others. When you upgrade WebLogic, keep your original WebLogicLicense.xml and add new keys to it for any new services you purchase.

  6. If you are using a non-US version of Windows NT you may receive a parsing error when the system does not recognize the date format included in the license. If you have this problem, modify the startWebLogic.cmd script included in your WebLogic installation directory by adding the option -Duser.language to your java command line.

Upgrading licenses from a previous release

Prior to release 4.0 of WebLogic Server, licenses were distributed in a compiled Java .class format. WebLogic licenses are now distributed in an XML format. If you are upgrading from an earlier release of WebLogic Server, please copy your license files, called either WeblogicLicense.XML or WebLogicLicense.class to your weblogic/license directory. (Where weblogic is the directory containing your WebLogic Server installation.)

If you purchase more than one product from WebLogic, you will have more than one entry in your license file. If you have purchased licenses for versions previous to 4.0, you may also have a .class format license file. All of your license files can be used together. When the WebLogic Server starts up, it looks for multiple license files in both formats in the following order:

  1. .class files in the weblogic/license directory

  2. .XML files in the directory specified with the weblogic.system.home property

  3. .XML files in the WebLogic Server classpath.

If WebLogic Server encounters an expired license, it will not continue to look for additional licenses. For this reason you should remove expired license keys from your license files. (If you are using a .class license file, you must recompile the WeblogicLicense.java file after removing the expired license.)

Always restart WebLogic Server after making any changes to your license files.

For users who have .class license files, BEA recommends that you use the convertLicense utility to convert your license file to an XML format license. You can then combine your XML licenses into a single file by cutting and pasting between the two files. For information on editing an XML style license, see Installing a WebLogic License.

If you need to add license keys to an older class-style license, please see Installing a WebLogic License.

Starting WebLogic Server on Windows NT

Start Menu

If you installed WebLogic Server on Windows with the InstallShield kit, you can use the WebLogic Server shortcut on the Windows start menu to start the WebLogic Server. Click on:

Start->Programs->WebLogic 4.5.1->WebLogic Server.

As installed, running the WebLogic Server from the start menu will invoke a 1.1.7B Java Runtime Environment (JRE). WebLogic Server is shipped with both a 1.1.7B and 1.2.1 (Java 2) JRE.

You can choose which JRE will be used as the default by selecting

Start->Programs->WebLogic 4.5.1->Utilities->Choose JRE 1.1 (or Choose JRE 1.2)

You can also use the t3config utility to select the default JRE. See Windows Convenience Programs for more information about this utility.

If you want to run the WebLogic Tour, you must use the 1.1.7B JRE.

NT Service

You can also run WebLogic Server as a Windows NT service. When installed as an NT service, WebLogic Server will start automatically when you boot the Windows NT computer. A WebLogic Server started in this way will use the same start up parameters (stored in the Windows Registry) that are used when starting a WebLogic Server using the Windows start menu or the Windows convenience program t3server.exe. These parameters may be changed by using the t3config.exe program, described under Windows Convenience Programs.

For additional information, see Using WebLogic Server as an NT 4.0 service.

You must have administrator-level privileges to either install or uninstall an application as an NT service.

To install WebLogic Server as a Windows NT service:

  1. Switch to the weblogic\bin directory.

  2. Run install.exe. For example,

    c:\weblogic\bin> install.exe

  3. If you wish to run multiple instances of WebLogic Server as NT services, name the instances by adding an additional parameter specifying the name for each server instance. For example:

    c:\weblogic\bin> install -name thisWebLogicServer

    Multiple instances of WebLogic Server can be useful when testing WebLogic Clusters on a single computer. There is additional information available on Installing and removing multiple WebLogic NT services.

Windows Convenience Programs

The following programs (Windows NT only) may be run from the weblogic/bin directory:

dbping.exe
Tests your connection to a database.
Arguments:
DBMS
Can be one of the following:
ORACLE
SYBASE
MSSQLSERVER
MSSQLSERVER4
INFORMIX4
user
Valid username for database login. Use the same values and format that you use with isql for SQL Server, sqlplus for Oracle, or DBACCESS for Informix.
password
Valid password for the user. Use the same values and format that you use with isql, sqlplus, or DBACCESS.
DB
Name of the database. The format varies depending on the database and version. Use the same values and format that you use with isql, sqlplus, or DBACCESS. Type 4 drivers, such as MSSQLServer4 and Informix4, need additional information to locate the server since they cannot access the environment.

For example:
dbping ORACLE scott tiger demo

install.exe
Installs WebLogic Server to run as a Windows NT service.

remove.exe
Removes WebLogic Server as a Windows NT service.

t3config.exe
Makes changes to your installation configuration. Note that t3config.exe changes settings in the Windows NT registry and therefore these settings will remain the defaults until you run t3config.exe again. These settings are used when running the t3server.exe convenience program (see below), when running WebLogic Server as an NT service, and when running WebLogic Server from the start menu.
The following options are available for t3config.exe. If no options are specified, t3config.exe prints a list of the current settings.

-jre 1.2 or 1.1
Sets the JRE used to run WebLogic Server. WebLogic Server is shipped with two JREs, versions 1.1 and 1.2 (Java 2).
-help
Prints a list of optional arguments for the t3config.exe command.
-msSizeInMb
Sets the initial Java heap size (in megabytes)
-mxSizeInMb
Sets the maximum Java heap size (in megabytes)
-JAVA_HOME path
Changes the JDK/JRE runtime directory on which the WebLogic installation depends. The default points to the directory where you installed the WebLogic distribution (for example, c:\weblogic), which is packaged with its own JRE.
-classpath path
Changes the system classpath on which the WebLogic installation depends. The default is unset; that is there are no directories in the classpath.
-Dproperty=value
Use the -D command to change other properties. These properties are stored in the Windows Registry and are used as command line arguments when starting the server using t3server.exe, the Start menu, and when starting as an NT service.

t3console.exe
Runs the WebLogic Console, an administrative tool.

t3server.exe
Runs WebLogic Server with the defaults defined by running t3config.exe (see above).

version.exe
Displays the current version of your WebLogic Server.

Starting WebLogic Server from the command line

The WebLogic Server is a Java class file, and like any Java application, you can start it with the java command. These instructions describe the options you need to include when starting WebLogic Server from the command line. The startup options described here will start WebLogic Server in a minimal configuration. To use any of the APIs or services of WebLogic Server, you should consult the Developers Guides, API Reference, and Deployment Guides included with the WebLogic Server documentation.

The following are required when starting WebLogic Server:

Command line examples

Here are some sample command lines you can use to start WebLogic Server. These examples assume that you installed WebLogic Server in the c:/weblogic directory and that your JDK 1.1 is located in the c:/java directory. Modify these commands, substituting the correct directories for your installation.

The samples also assume that you are starting WebLogic Server from the installed directory. If you are starting from a different directory, add the following property to the command line, substituting the directory containing your WebLogic Server installation:

-Dweblogic.system.home=c:/weblogic

Where c:/weblogic is the directory containing your weblogic.properties file. (This is usually the same as the directory where you installed WebLogic Server.)

Although these examples are broken into multiple lines for readability, the commands should be entered as one line.

JDK 1.1.x example

 $ java -ms32m -mx32m -classpath 
c:/java/lib/classes.zip;
c:/weblogic/classes/boot
-Dweblogic.class.path=c:/weblogic/classes;
c:/weblogic/license;c:/weblogic/lib/weblogicaux.jar;
c:/weblogic/myserver/serverclasses weblogic.Server

JDK 1.2 (Java 2) example

 $ java -ms32m -mx32m -classpath c:/weblogic/classes/boot 
-Dweblogic.class.path=c:/weblogic/classes;
c:/weblogic/license;c:/weblogic/lib/weblogicaux.jar;
c:/weblogic/myserver/serverclasses
-Djava.security.manager
-Djava.security.policy==c:/weblogic/weblogic.policy
weblogic.Server

Jview example

$ jview /cp c:\weblogic\classes\boot;
c:\weblogic\classes;
c:\weblogic\license;c:\weblogic\lib\weblogicaux.jar;
c:\weblogic\myserver\serverclasses weblogic.Server

There is additional important information you should be aware of when using Jview. Please read the section Microsoft SDK for Java (JView.

Additional options:

Starting WebLogic Enterprise Connectivity

To start WebLogic Enterprise Connectivity with JDK 1.2 (Java 2), add the following to the Java system classpath:

 c:/weblogic/lib/poolorb.jar

For more information, see the Developers Guide Using WebLogic Enterprise Connectivity.

Starting WebLogic Server from the WebLogic Console

The WebLogic Console is a pure-Java GUI management console where you can monitor WebLogic Server performance and other aspects of the WebLogic Server's environment. You can also use the console to start WebLogic Server. For more information, see Running the WebLogic Console.

To start WebLogic Server from the console:

  1. Start the console from the Windows NT start menu by selecting
    Start->Programs->WebLogic->WebLogic Console, or use the following command:

    $ java -mx32m -classpath c:/java/lib/classes.zip; c:/weblogic/classes;c:/weblogic/lib/weblogicaux.jar weblogic.Console

    Where c:/java is the path to your JDK (this may be omitted when running under Java 2) and c:/weblogic is the path to your WebLogic Server installation.

    You can also start the WebLogic Console with the supplied scripts, startConsole.sh (UNIX) and startConsole.cmd (Windows NT), and startConsoleJview.cmd (Windows NT running under Microsoft SDK for Java). These scripts are located in the root directory of your WebLogic distribution.

    You will need to modify these scripts for your environment. See Starting WebLogic Server using scripts.

  2. From the console menu bar, click on:

    File ->Start a new WebLogic Server or Cluster.
    A dialog box will appear. Fill in the following information:

    Name of the server
    The name of the WebLogic Server you are starting. This parameter is used when identifying WebLogic Servers within a WebLogic Cluster. The default name for starting a single WebLogic Server is myserver.
    User
    For privileged, administration-level access the user is always system.
    Password
    This is the password you entered when installing WebLogic Server. It is stored in the weblogic.properties file under the property weblogic.password.system.
    WebLogic home
    The directory where you installed WebLogic Server.
    Enable cluster
    Check this box if you are starting a WebLogic Server as part of a WebLogic Cluster.
    Cluster name
    The name of the WebLogic Cluster that this WebLogic Server will join.
    Advanced
    The Advanced button opens a dialog box where you can set the Listen port, SSL listen port, Java heap size, Multicast address, and bind address.

Starting WebLogic Server using scripts

Sample scripts are provided with the WebLogic distribution that you can use to start WebLogic Server. You will need to modify these scripts to fit your environment and applications: The scripts are called startWebLogic.sh (UNIX), startWeblogic.cmd (Windows NT), and startWebLogicJview.cmd (Windows NT running under Microsoft SDK for Java). These scripts are located in the root directory of your WebLogic distribution.

To use the supplied scripts:

Next steps

If you will be using any of the supplied WebLogic JDBC drivers, see Installing JDBC Drivers.

For information on using WebLogic Servers in clusters, see Using WebLogic Clusters.

WebLogic Server comes with many code examples to help you get started. See the Guide to the WebLogic code examples.

Other Documentation