|
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
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 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.
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:
Omit if you are using Java 2 (JDK 1.2.x)
Where /weblogic is the path to the directory where you installed WebLogic Server and /java is the path to the JDK directory.
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:
Occasionally, you may encounter classes that cannot be placed in the WebLogic classpath. If you receive any unexplained "Class not found" errors, the problem may be that the class was written in such a way that it cannot be loaded with the class loader used by WebLogic Server. Such a class should be included in the Java system classpath as an additional argument to the -classpath option.
Example of setting classpath to run WebLogic Server under JDK 1.1.x (should be entered all on one line):
$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
Where c:/weblogic is the path to the directory where you installed WebLogic Server and c:/java is the path to your JDK directory.
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:
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/-" {
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:
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>
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 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.
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:
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.
Windows Convenience Programs
The following programs (Windows NT only) may be run from the weblogic/bin directory:
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:
If you are using Java 2, omit c:/java/lib/classes.zip from the -classpath option.
c:/weblogic/license;c:/weblogic/lib/weblogicaux.jar;
c:/weblogic/myserver/serverclasses
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 -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
$ 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.
-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:
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.
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), 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.
chmod +x startWebLogic.sh
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
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|