![]() |
![]() |
|
Setting up and Starting WebLogic Server 5.1
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
Setting the system PATH
Setting the classpath
Setting up the Java security manager for Java 2
Installing a WebLogic license
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
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 (the Java Virtual Machine or JVM) 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.
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.
Native vs. Green Threads
Most JDKs include an option to run the JVM using native or green threads. Always run WebLogic Server using native threads. Some JVMs, such as the JDK 1.2.2 for Solaris default to green threads. Usually passing the -native option on the java command line will force the JVM to use native threads. However, this implementation is not consistent across JDKs. Consult the documentation for you JDK to make sure that you correctly specify the use of native threads.
Hot Spot
Hot Spot is an enhancement to the standard JVM that uses a Just-in-time compiler and other features designed to improve performance. If you want to use a Hot Spot JVM, check the WebLogic Server platforms page to make sure that its use is supported for your platform.
Under most JDKs you can specify that the Hot Spot JVM not be used by adding the -classic option to the java command line. This can be useful if you require thread dumps while debugging an application. Because Hot Spot uses a JIT, thread dumps are not available.
Setting the environment
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 the type-2 WebLogic jDriver for Oracle, you must also include the path to both the Oracle-supplied and the BEA-supplied client libraries for your driver. See Installing WebLogic jDriver for Oracle 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.
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.
Note: If you are using Microsoft SDK for Java (Jview) as your JDK, you must set the Java system classpath with the environment variable CLASSPATH. Using the /cp command line option to specify the Java system classpath will not allow WebLogic Server to start. For more information, see Microsoft SDK for Java (JView).
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 any 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 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 perform several steps, including re-compiling, to update them for use with this release. For more information, see Upgrading EJBs to WebLogic Server Version 5.1.
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.
Setting your Java system classpath
The following must be included as arguments to the -classpath option on the java command line:
Where /weblogic is the path to the directory where you installed WebLogic Server and /java is the path to the JDK directory.
Setting your WebLogic classpath
The following must be included as values for the -Dweblogic.class.path property. These classes will be loaded using the Weblogic classloader:
Example of setting classpath to run WebLogic Server under JDK 1.1.x (should be entered all on one line):
$java -ms64m -mx64m -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
Where c:/weblogic is the path to the directory where you installed WebLogic Server and c:/java is the path to your JDK directory.
Verbose output of classloader
To see the location of classes loaded by the WebLogic classloader, you can set the following property in the command line or script used to start WebLogic Server:
-Dweblogic.classloader.verbose=true.
When this property is set, the location of loaded classes will be displayed as WebLogic Server starts up.
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 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.
Specify the following special property when starting the server under jview. This property prevents WebLogic Server from using the weblogic.class.path property to load classes:
/d:weblogic.system.disableWeblogicClassPath=true
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, with the environment variable CLASSPATH, along with the classes which normally belong in the Java system classpath.
jview /d:weblogic.system.disableWeblogicClassPath=true
weblogic.Server
Where c:\weblogic is the path to the directory where you installed WebLogic Server.
Using jview with WebLogic COM
If you are using WebLogic COM, also set your trusted classpath. See Using WebLogic COM for more information.
The WebLogic Frequently Asked Questions also has a section on jview.
Using jview with RMI
If you will be using RMI with jview, you must add the following zip file to your Java system classpath (by adding it to the CLASSPATH environment variable) when starting WebLogic Server:
weblogic/lib/rmiForMs.zip
Where weblogic is the directory where you installed WebLogic Server
Starting WebLogic Server Statically
You can start WebLogic Server statically, without using the weblogic.class.path to specify its classes. This can be useful when using some Integrated Development Environments (IDE) or when running a debugger. However, when you start WebLogic Server statically, you can not deploy EJBs or servlets in a running WebLogic Server (re-starting WebLogic Server is required).
To start WebLogic Server statically:
-Dweblogic.system.disableWeblogicClassPath=true
This property prevents WebLogic Server from using the weblogic.class.path property to load classes.
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:
grant codeBase "file:/c:/weblogic/-" {
permission java.io.FilePermission "c:${/}weblogic${/}-", ...
For example,
$ java ... -Djava.security.manager
-Djava.security.policy==c:/weblogic/weblogic.policy
Be sure to use "==" instead of "=" when specifying java.security.policy, so that only the weblogic.policy file is used by Java security manager. The == causes the weblogic.policy file to override any default security policy. A single equal sign causes the weblogic.policy file to be appended to an existing security policy. For more information on setting up a security policy, see the article Default Policy Implementation and Policy File Syntax on the JavaSoft website.
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:
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/" {
Problems occur when using "/-" in the specified URL. This has been acknowledged by Sun Microsystems as bug # 4261298, but they have determined that this is not a bug in their JDK. They state, "when a path is trailed with "/-" it means that the element preceding it is a directory and that grant functions for all elements below it. It does not mean that you can read the directory itself." The workaround for this nuance is to add an additional FilePermission entry that consists of just the directory itself (with no trailing "/-").
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:
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-2001"
KEY="w20f8s08480v0adpup3485paprtnp8ac"
/>
... </WEBLOGIC-LICENSES>
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:
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
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 5.1->WebLogic Server.
You can use the wlconfig utility to select the various defaults used when starting WebLogic Server from the Start menu. See Windows Convenience Programs for more information about this utility.
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 wlserver.exe. These parameters may be changed by using the wlconfig.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:
c:\weblogic\bin> install.exe
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.
The WebLogic Windows Service Program (beasvc.exe)
The scripts for installing and removing a WebLogic Server as a Windows service invoke the WebLogic Windows Service program, beasvc.exe. Multiple instances of WebLogic Server can be installed or removed as a Windows service using beasvc.exe. All configurations for multiple services are stored in the Windows Registry using a different service name and under a server-specific hive at:
HKEY_LOCAL_MACHINE\SYSTEM\Current\ControlSet\Services
The following two files were added to WebLogic Server 5.1 Service Pack 10:
- beasvc.exe (Binary to start and stop services for 1.2 and above JVM)
- beasvc_117.exe (Binary to start and stop services for 1.1 JVM)
When you start the service, the Windows registry entries are picked up and the JVM is initialized and started. Since each service that is installed is independent of the others, you can install multiple instances of WebLogic Server to run as a Windows service, provided that each service is given a unique name.
The following options are available with beasvc.exe:
Install the specified service.
Remove the specified service.
The user-specified name of the service to be installed or removed.
-cmdline: java_cmdline_parameters
The java command-line parameters to be used when starting the WebLogic Server as a Windows service.
Root directory of the Java installation. The start command will be formed by appending \bin\java to java_directory.
Directory where this startup command will be executed.
-extrapath: additional_env_settings
Additional path settings that will be prepended to the path applicable to this command execution.
Prints out the usage for the beasvc.exe command.
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. With the 1.2 or later version of the Sun Microsystems JVM, you can specify a file that contains the classpath using the @ option. You could use this option with beasvc.exe as in the following example:
beasvc -install -svcname:myservice -classpath:@C:\temp\myclasspath.txt
Installing a service sample:
beasvc -install \
-svcname:<Service_Name> \
-javahome:<Java_Home_Directory> \
-execdir:<WebLogic_Home_Directory> \
-extrapath:<Path_To_Prepend> \
-cmdline:%CMDLINE%
Uninstalling a service sample:
beasvc -remove \
-svcname:<Service_Name>
Starting a service:
Windows Convenience Programs
The following programs (Windows NT only) may be run from the weblogic/bin directory:
Note: The names of these programs changed as of Version 5.0 of WebLogic Server:
t3config is now wlconfig
t3server is now wlserver
t3console is now wlconsole
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.
You will notice that the command lines required to start WebLogic Server can be quite lengthy and tedious to type. To make sure that your start-up commands are accurate, BEA recommends that you incorporate these command lines into scripts that you can then use to start WebLogic Server. For more information, see Starting WebLogic Server using scripts
Important note regarding WebLogic RMI over IIOP
If you are using WebLogic RMI over IIOP, see Using WebLogic RMI over IIOP.
Requirements for Starting WebLogic Server
The following are required when starting WebLogic Server:
If you are using Java 2, omit c:/java/lib/classes.zip from the -classpath option.
Where c:/weblogic is the directory where you installed WebLogic Server and c:/java is the path to your JDK.
-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.)
-Dweblogic.home=weblogic
Where weblogic is the path to the directory where you installed WebLogic Server. Note that this property is different than the weblogic.system.home property.
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 -ms64m -mx64m -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
$ java -ms64m -mx64m -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 /d:weblogic.system.disableWeblogicClassPath=true
weblogic.Server
There is important information you should be aware of when using Jview. Please read the section Microsoft SDK for Java (JView).
-Dweblogic.system.home=c:/weblogic (or the directory containing your weblogic.properties file)
c:\weblogic\eval\cloudscape\lib\cloudscape.jar to the -classpath option.
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:
$ 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.
File ->Start a new WebLogic Server or Cluster.
A dialog box will appear. Fill in the following information:
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) and startWeblogic.cmd (Windows NT). These scripts are located in the root directory of your WebLogic distribution.
chmod +x startWebLogic.sh
Set up your development environment
Scripts called setEnv.cmd (Windows NT) or setEnv.sh (UNIX) are included in the root directory of your WebLogic Server installation. These scripts will set up the appropriate environment for development and running the code examples included with WebLogic Server. You will need to modify these scripts somewhat for your environment. For more information, see Setting your development environment.
Install JDBC drivers for use with WebLogic Server
If you will be using a JDBC driver for database access, see the following links:
Oracle
Installing WebLogic jDriver for Oracle. Users upgrading from an earlier release of WebLogic Server should pay special attention to their Oracle configuration. There are now several versions of this driver available and these additions require that you set your PATH (Windows NT) or shared library path (Unix) differently.
Using the Oracle thin driver with WebLogic Server contains information on using Oracle's thin driver (available from Oracle).
Informix
Installing WebLogic jDriver for Informix.
Microsoft SQL Server
Installing WebLogic jDriver for Microsoft SQL Server.
Sybase
The jConnect JDBC driver from Sybase is now bundled with WebLogic Server. For information on using this driver with WebLogic Server, see Using the Sybase jConnect driver.
Other Documentation
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|