bea.com | products | dev2dev | support | askBEA |
|
e-docs > WebLogic Server > WebLogic Server Partners' Guide > Customizing WebLogic Server Configuration Files |
WebLogic Server Partners' Guide |
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:
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.
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.
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"
>
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.
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"
/>
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/weblogic810/samples/server/stage/petstore">
<WebAppComponent
Name="tour"
Targets="petstoreServer"
URI="tour.war"
/>
Note that the c:\bea\wlserver810 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.
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 8.1. 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: