WebLogic Server Partners' Guide

 Previous Next Contents View as PDF  

Customizing WebLogic Server Configuration Files

WebLogic Server stores configuration information, such as security credentials and the list of deployable resources and applications, in a set of configuration files.

The following sections highlight typical modifications that partners and ISVs make to the WebLogic Server configuration files that they distribute with their applications:

 


Customizing the config.xml File

The config.xml file defines the majority of configuration settings for all WebLogic Servers in a management domain. For example, config.xml controls all details of a given domain, including the name, number and configuration of servers and cluster; the list of deployable resources and applications; and the mapping of deployable resources and applications to servers and clusters.

Usually, we recommend that you use such WebLogic Server tools as the Administration Console and weblogic.Admin utility to modify the config.xml file. Partners, however, may need to edit this file directly in order to customize an installation.

The following sections highlight elements of the config.xml file that partners might modify for their installations:

If you are unfamiliar with the role of the config.xml file or management domains, refer to the following topics:

If you are unfamiliar with editing config.xml directly, see the BEA WebLogic Server Configuration Reference, which provides conventions for editing config.xml and a description of the file's Document Type Definition (DTD).

Pre-Configuring Application Resources

Partner applications typically rely on several WebLogic Server resources, each of which is defined in the config.xml file:

Resources

config.xml Elements

Notes

Domain

Domain

To act as a cohesive unit, all WebLogic Servers that host a component of your application must reside within a single WebLogic Server administrative domain.

Server Names and Connection Information

Server

Partner applications can be configured to access one or more WebLogic Server names, IP addresses, and/or port numbers, or, if necessary for your application, you can hard-code a WebLogic Server domain to use specific server names and connection ports.

IP Addresses can be configured dynamically by the application installer and embedded into a config.xml before installing the configuration.

JDBC Datasources

JDBCConnectionPool

JDBCDataSource

JDBCMultiPool

JDBCTxDataSource

Partner applications that install WebLogic Server also frequently install an RDBMS or other datastore for maintaining the application data. If your product installer installs a datastore along with the application, you may want to pre-configure the installed WebLogic Server to set up a default datasource and connection pool for the datastore.

Deployment of Application Components

Partner applications can also be installed by adding the necessary elements to config.xml. Installing an application into a pre-configured WebLogic Server, however, requires coordination between the config.xml settings and the installed location of application component files (.war, .jar, .html and so forth).

The table below provides a summary of elements used to pre-deploy application components within WebLogic Server. See Example Configuration for an example of how these elements correspond to the installed location of actual application component files.

Components

config.xml Elements

Notes

Startup Classes

StartupClass

WebLogic Server startup classes can be used to initialize resources required by other components of the partner application.

Webserver

WebServer

Web applications typically require standard web resources, such as static .html content, in addition to business logic. Use the config.xml file to configure the default location of these static files for the application.

Web Applications

Application

EAR and WAR files can be stored anywhere in your application directory or the WebLogic Server directory. Reference the final installed location from within config.xml to deploy the application on startup.

 


Example Configuration

The WebLogic Server Pet Store is based on the Sun Microsystems Java Pet Store 1.3 demo. It includes four enterprise applications and one Web application that demonstrate various aspects of the J2EE platform.

WebLogic Server Pet Store provides a simple example of how to pre-configure an installation to support enterprise applications. For information about starting WebLogic Server Pet Store, refer to Samples and Examples on the WebLogic Server documentation Web site.

This section highlights key aspects of the config.xml file that configures WebLogic Server Pet Store.

Domain Configuration

The parent element in the config.xml file, <Domain>, provides the configuration for the petstore domain. All of the application's servers, resources, and components are defined within this element:

<Domain
  Name="petstore"
  >

Basic Server Setup

The WebLogic Server Pet Store uses a single server named petstoreServer. The connection properties for this server are preconfigured in the Server element attributes as follows:

<Server
    JavaCompiler="C:\bea\jdk131_02/bin/javac"
    ListenPort="7001"
    Name="petstoreServer"
    ServerVersion="7.0.0.0"
    IIOPEnabled="false"
  >

The remainder of the server setup configures the default Web Server and SSL configuration for the server.

JDBC Requirements

To demonstrate the use of multiple JDBC connection pools, WebLogic Server Pet Store defines and three JDBC connection pools. It also defines four JDBC datasources, one for each application within the Pet Store. All of the JDBC pools and datasources are deployed (targeted) on the default Pet Store server, petstoreServer.

<JDBCConnectionPool
    CapacityIncrement="1"
    DriverName="com.pointbase.jdbc.jdbcUniversalDriver"
    InitialCapacity="1"
    MaxCapacity="10"
    Name="petstorePool"
    Password="petstore"
    Properties="user=petstore"
    RefreshMinutes="0"
    ShrinkPeriodMinutes="15"
    ShrinkingEnabled="true"
    Targets="petstoreServer"
    TestConnectionsOnRelease="false"
    TestConnectionsOnReserve="false"
    URL="jdbc:pointbase:server://localhost/demo"
/>

<JDBCConnectionPool
    CapacityIncrement="1"
    DriverName="com.pointbase.jdbc.jdbcUniversalDriver"
    InitialCapacity="1"
    MaxCapacity="10"
    Name="petstoreopcPool"
    Password="petstoreopc"
    Properties="user=petstoreopc"
    RefreshMinutes="0"
    ShrinkPeriodMinutes="15"
    ShrinkingEnabled="true"
    Targets="petstoreServer"
    TestConnectionsOnRelease="false"
    TestConnectionsOnReserve="false"
    URL="jdbc:pointbase:server://localhost/demo"
/>

<JDBCConnectionPool
    CapacityIncrement="1"
    DriverName="com.pointbase.jdbc.jdbcUniversalDriver"
    InitialCapacity="1"
    MaxCapacity="10"
    Name="petstoresupplierPool"
    Password="petstoresupplier"
    Properties="user=petstoresupplier"
    RefreshMinutes="0"
    ShrinkPeriodMinutes="15"
    ShrinkingEnabled="true"
    Targets="petstoreServer"
    TestConnectionsOnRelease="false"
    TestConnectionsOnReserve="false"
    URL="jdbc:pointbase:server://localhost/demo"
/>

<JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="datasource-petstorePool"
    Name="PetstoreDataSource"
    PoolName="petstorePool"
    Targets="petstoreServer"
/>

<JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="datasource-petstoreopcPool"
    Name="PetstoreOPCDataSource"
    PoolName="petstoreopcPool"
    Targets="petstoreServer"
/>

<JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="datasource-petstoresupplierPool"
    Name="PetstoreSupplierDataSource"
    PoolName="petstoresupplierPool"
    Targets="petstoreServer"
/>

<JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="jdbc/CatalogDataSource"
    Name="CatalogDataSource"
    PoolName="petstorePool"
    Targets="petstoreServer"
/>

Application Components

The Pet Store application installs five application component files: tour.war, petstore.ear, opc.ear, supplier.ear and petstoreadmin.ear. These components are each installed within the WebLogic Server subdirectory and deployed to petstoreServer. For example, on Windows, tour.war is deployed using the following element:

<Application
   Deployed="true"
   Name="tour"
   Path="C:/bea/weblogic700/samples/server/stage/petstore">

<WebAppComponent
   Name="tour"
   Targets="petstoreServer"
   URI="tour.war"
/>

</Application>

Note that the c:\bea\wlserver700 portion of the application component path is determined during the WebLogic Server installation, while the remaining portion of the path is hard-coded. Your application installer can use a similar technique to install application components in a subdirectory unrelated to WebLogic Server, if necessary.

Startup Classes

On Windows systems, the Pet Store application uses a startup class to initiate the system web browser after the petstoreServer is booted. The definition for this startup class is mostly hard-coded in the installed config.xml file; only the port number is set dynamically by the WebLogic Server installation program:

<StartupClass </Application>
   Arguments="port=7001"
   ClassName="com.bea.estore.startup.StartBrowser"
   FailureIsFatal="false"
   Name="StartBrowser"
   Targets="petstoreServer"
   Notes="On Windows, this class automatically starts a browser after the server has finished booting."
   />

 


Customizing Files for Compatibility Security

Compatibility security refers to the capability of running security configurations from WebLogic Server 6.x in WebLogic Server 7.0. If you run WebLogic Server with Compatibility security, your distribution must include the following:

If your application requires integration with a third-party security realm (for example, single sign-on using the Windows NT security realm), you must also configure a caching realm.

For more information on WebLogic Server security, refer to the following topics:

 

Back to Top Previous Next