Programming WebLogic J2EE Connectors

 Previous Next Contents Index View as PDF  

weblogic-ra.xml Deployment Descriptor Elements

The following sections provide a complete reference for the WebLogic Server-specific XML deployment descriptor properties used in the WebLogic Server resource adapter archive and an explanation of how to edit the XML deployment descriptor. Use these sections if you need to refer to the deployment descriptor used for resource adapters.

If your resource adapter archive (RAR) does not contain a weblogic-ra.xml file, WebLogic Server automatically generates this file for you.

 


Manually Editing XML Deployment Files

To define or make changes to the XML deployment descriptors used in the WebLogic Server resource adapter archive, you must manually define or edit the XML elements in the weblogic-ra.xml file.

Basic Conventions

To manually edit XML elements:

<max-config-property></max-config-property>

DOCTYPE Header Information

When editing or creating XML deployment files, it is critical to include the correct DOCTYPE header for each deployment file. In particular, using an incorrect PUBLIC element within the DOCTYPE header can result in parser errors that may be difficult to diagnose.

The header refers to the location and version of the Document Type Definition (DTD) file for the deployment descriptor. Although this header references an external URL at java.sun.com, WebLogic Server contains its own copy of the DTD file, so your host server need not have access to the Internet. However, you must still include this <!DOCTYPE...> element in your ra.xml file, and have it reference the external URL because the version of the DTD contained in this element is used to identify the version of this deployment descriptor.

The entire DOCTYPE headers for the ra.xml and weblogic-ra.xml files are as follows:

XML File

DOCTYPE header

ra.xml

<!DOCTYPE connector PUBLIC
'-//Sun Microsystems, Inc.//DTD Connector 1.0//EN'
'http://java.sun.com/dtd/connector_1_0.dtd'>

weblogic-ra.xml

<!DOCTYPE weblogic-connection-factory-dd PUBLIC

"-//BEA Systems, Inc.//DTD WebLogic 7.0.0 Connector//EN" "http://www.bea.com/servers/wls700/dtd/weblogic700-ra.dtd">

XML files with incorrect header information may yield error messages similar to the following, when used with a utility that parses the XML (such as ejbc):

SAXException: This document may not have the identifier `identifier_name'

identifier_name generally includes the invalid text from the PUBLIC element.

Document Type Definitions (DTDs) for Validation

The contents and arrangement of elements in your XML files must conform to the Document Type Definition (DTD) for each file you use. ProductName utilities ignore the DTDs embedded within the DOCTYPE header of XML deployment files, and instead use the DTD locations that were installed along with the server. However, the DOCTYPE header information must include a valid URL syntax in order to avoid parser errors.

The following links provide the public DTD locations for XML deployment files used with ProductName:

Note: Most browsers do not display the contents of files having the .dtd extension. To view the DTD file contents in your browser, save the links as text files and view them with a text editor.

 


Using the Console Deployment Descriptor Editor to Edit Files

This section describes the procedure for editing the following resource adapter deployment descriptors using the Administration Console Deployment Descriptor Editor:

For detailed information about the elements in the resource adapter deployment descriptors, refer to Programming the WebLogic J2EE Connector Architecture.

To edit the resource adapter deployment descriptors, follow these steps:

  1. Invoke the Administration Console in your browser using the following URL:

    http://host:port/console

    where host refers to the name of the computer upon which WebLogic Server is running and port refers to the port number to which it is listening.

  2. Click to expand the Deployments node in the left pane.

  3. Click to expand the Connectors node under the Deployments node.

  4. Right-click the name of the resource adapter whose deployment descriptors you want to edit and choose Edit Connector Descriptor from the drop-down menu.

    The Administration Console window appears in a new browser. The left pane contains a tree structure that lists all the elements in the two resource adapter deployment descriptors and the right pane contains a form for the descriptive elements of the ra.xml file.

  5. To edit, delete, or add elements in the resource adapter deployment descriptors, click to expand the node in the left pane that corresponds to the deployment descriptor file you want to edit, as described in the following list:

  6. To edit an existing element in one of the resource adapter deployment descriptors, follow these steps:

    1. Navigate the tree in the left pane, clicking on parent elements until you find the element you want to edit.

    2. Click the element. A form appears in the right pane that lists either its attributes or sub-elements.

    3. Edit the text in the form in the right pane.

    4. Click Apply.

  7. To add a new element to one of the resource adapter deployment descriptors, follow these steps:

    1. Navigate the tree in the left pane, clicking on parent elements until you find the name of the element you want to create.

    2. Right-click the element and chose Configure a New Element from the drop-down menu.

    3. Enter the element information in the form that appears in the right pane.

    4. Click Create.

  8. To delete an existing element from one of the resource adapter deployment descriptors, follow these steps:

    1. Navigate the tree in the left pane, clicking on parent elements until you find the name of the element you want to delete.

    2. Right-click the element and chose Delete Element from the drop-down menu.

    3. Click Yes to confirm that you want to delete the element.

  9. Once you have made all your changes to the resource adapter deployment descriptors, click the root element of the tree in the left pane. The root element is the either the name of the resource adapter *.rar archive file or the display name of the resource adapter.

  10. Click Validate if you want to ensure that the entries in the resource adapter deployment descriptors are valid.

  11. Click Persist to write your edits of the deployment descriptor files to disk in addition to WebLogic Server's memory.

 


Using WebLogic Builder to Edit Deployment Descriptors

WebLogic Builder provides a visual environment for editing an application's deployment descriptor XML files. You can view these XML files as you visually edit them in WebLogic Builder, but you won't need to make textual edits to the XML files.

Use WebLogic Builder for the following development tasks:

For instructions on using WebLogic Builder, refer to the WebLogic Builder doocumentation.

 


weblogic-ra.xml DTD

Listing 8-2 weblogic-ra.xml DTD

<!--
XML DTD for WebLogic Server v7.0 specific Resource Adapter deployment descriptor.
This DTD is intended to be accompanied with the J2EE Connector Architecture v1.0 Resource Adapter deployment descriptor (ra.xml).
Overview of changes since weblogic600-ra.dtd:
 * Deprecated connection-cleanup-frequency and connection-duration-time. Replaced these elements with connection-maxidle-time.
 * Added connection-profiling-enabled.
 * Deprecated security-principal-map. The Password Credential information originally stored in this element will now be stored in internal WebLogic Server storage. Refer to the Programming the WebLogic J2EE Connector Architecture guide for more details.
Copyright (c) 2002 by BEA Systems, Inc. All Rights Reserved.
-->
<!--
This DTD defines the Weblogic specific deployment information for defining a deployable Resource Adapter Connection Factory. It provides for complete specification of all configurable Connection Factory parameters including Connection Pool parameters, Security parameters for Resource Principal Mapping and the ability to define values for configuration parameters which exist in the ra.xml deployment descriptor.
-->
<!--
The weblogic-connection-factory-dd element is the root element of the Weblogic specific deployment descriptor for the deployed resource adapter.
-->
<!ELEMENT weblogic-connection-factory-dd (connection-factory-name, description?, jndi-name, ra-link-ref?, native-libdir?,pool-params?, (logging-enabled, log-filename)?, map-config-property*, security-principal-map?)>
<!--
The connection-factory-name element defines that logical name that will beassociated with this specific deployment of the Resource Adapter and its corresponding Connection Factory.
The value of connection-factory-name can be used in other deployed Resource Adapters via the ra-link-ref element. This will allow multiple deployed Connection Factories to utilize a common deployed Resource Adapter, as well as share configuration specifications.
This is a required element.
-->
<!ELEMENT connection-factory-name (#PCDATA)>
<!--
The description element is used to provide text describing the parent element. The description element should include any information that the deployer wants to describe about the deployed Connection Factory.
This is an optional element.
-->
<!ELEMENT description (#PCDATA)>
<!--
The jndi-name element defines the name that will be used to bind the Connection Factory Object into the Weblogic JNDI Namespace. Client EJBs and Servlets will use this same JNDI in their defined Reference Desciptor elements of the weblogic specific deployment descriptors. 
This is a required element.
-->
<!ELEMENT jndi-name (#PCDATA)>
<!--
The ra-link-ref element allows for the logical association of multiple deployed Connection Factories with a single deployed Resource Adapter. The specification of the optional ra-link-ref element with a value identifying a separately deployed Connection Factory will result in this newly deployed Connection Factory sharing the Resource Adapter which had been deployed with the referenced Connection Factory.
In addition, any values defined in the referred Connection Factories deployment will be inherited by this newly deployed Connection Factory unless specified.
This is an optional element.
-->
<!ELEMENT ra-link-ref (#PCDATA)>
<!--
The native-libdir element identifies the directory location to be used for all native libraries present in this resource adapter deployment. As part of deployment processing, all encountered native libraries will be copied to the location specified.
It is the responsibility of the Administrator to perform the necessary platform actions such that these libraries will be found during Weblogic Server runtime.
This is a required element IF native libraries are present.
-->
<!ELEMENT native-libdir (#PCDATA)>
<!--
The pool-params element is the root element for providing Connection Pool specific parameters for this Connection Factory.
Weblogic will use these specifications in controlling the behavior of the maintained pool of Managed Connections.
This is an optional element. Failure to specify this element or any of its specific element items will result in default values being assigned. Refer to the description of each individual element for the designated default value.
-->
<!ELEMENT pool-params (initial-capacity?, max-capacity?, capacity-increment?, shrinking-enabled?, shrink-period-minutes?, connection-cleanup-frequency?, connection-duration-time?, connection-maxidle-time?, connection-profiling-enabled?)>
<!--
The initial-capacity element identifies the initial number of managed connections which the Weblogic Server will attempt to obtain during deployment.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Default Value:	1
-->
<!ELEMENT initial-capacity (#PCDATA)>
<!--
The max-capacity element identifies the maximum number of managed connections which the Weblogic Server will allow. Requests for newly allocated managed connections beyond this limit will result in a ResourceAllocationException being returned to the caller.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Default Value: 10
-->
<!ELEMENT max-capacity (#PCDATA)>
<!--
The capacity-increment element identifies the number of additional managed connections which the Weblogic Server will attempt to obtain during resizing of the maintained connection pool.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Default Value:	1
-->
<!ELEMENT capacity-increment (#PCDATA)>
<!--
The shrinking-enabled element indicates whether or not the Connection Pool should have unused Managed Connections reclaimed as a means to control system resources.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Value Range:	true|false
Default Value:	true
-->
<!ELEMENT shrinking-enabled (#PCDATA)>
<!--
The shrink-period-minutes element identifies the amount of time the Connection Pool Management will wait between attempts to reclaim unused Managed Connections.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Default Value:	15
-->
<!ELEMENT shrink-period-minutes (#PCDATA)>
<!--
The connection-cleanup-frequency element identifies the amount of time (in seconds) the Connection Pool Management will wait between attempts to destroy Connection handles which have exceeded their usage duration. This element, used in conjunction with connection-duration-time, prevents connection leaks when an Application may have not closed a connection after completing usage.
This element is deprecated. This is being replaced with connection-maxidle-time.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Default Value:	-1
-->
<!ELEMENT connection-cleanup-frequency (#PCDATA)>
<!--
The connection-duration-time element identifies the amount of time (in seconds) a Connection handle can be active. This element, used in conjunction with connection-cleanup-frequency, prevents leaks when an Application may have not closed a connection after completing usage.
This element is deprecated. This is being replaced with connection-maxidle-time.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Default Value:	-1
-->
<!ELEMENT connection-duration-time (#PCDATA)>
<!--
The connection-maxidle-time element identifies the amount of time (in seconds) a Connection handle can remain idle. This element prevents leaks when an Application may have not closed a connection after completing usage. Idle connections will only be terminated in the case where the connection pool becomes full, and a new connection request is about to fail because of this.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Default Value:	0
-->
<!ELEMENT connection-maxidle-time (#PCDATA)>
<!--
The connection-profiling-enabled element indicates whether or not the Connection Pool should store the call stacks of where each Connection is allocated. If enabled this information can be viewed on active Connections through the console. Also, the stacks for Leaked and Idle connections will be available if this is enabled and can help debug components that fail to close connections.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Value Range:	true|false
Default Value:	false
-->
<!ELEMENT connection-profiling-enabled (#PCDATA)>
<!--
The logging-enabled element indicates whether or not the log writer is set for either the ManagedConnectionFactory or ManagedConnection. If this element is set to true, output generated from either the ManagedConnectionFactory or ManagedConnection will be sent to the file specified by the log-filename element.
This is an optional element.
Failure to specify this value will result in Weblogic using its defined default value.
Value Range:	true|false
Default Value:	false
-->
<!ELEMENT logging-enabled (#PCDATA)>
<!--
The log-filename element specifies the name of the log file which outputgenerated from either the ManagedConnectionFactory or a ManagedConnection are sent.
The full address of the filename is required.
This is an optional element.
-->
<!ELEMENT log-filename (#PCDATA)>
<!--
Each map-config-property element identifies a configuration property name and value that corresponds to an ra.xml config-entry element with the corresponding config-property-name.
At deployment time, all values present in a map-config-property specification will be set on the ManagedConnectionFactory.
Values specified via a map-config-property will supersede any default value that may have been specified in the corresponding ra.xml config-entry element.
This is an optional element.
-->
<!ELEMENT map-config-property (map-config-property-name, map-config-property-value)> <!ELEMENT map-config-property-name (#PCDATA)> <!ELEMENT map-config-property-value (#PCDATA)>
<!--
Each security-principal-map element provides a mechanism to define appropriate Resource Principal values for Resource Adapter/EIS authorization processing, based upon the known Weblogic Runtime Initiating Principal.
This map allows for the specification of a defined set of Initiating Principals and the corresponding Resource Principal's Username and Password that should be used when allocating Managed Connections and Connection Handles.
A default Resource Principal can be defined for the Connection Factory via the map. By specifying an initiating-principal value of '*' and a corresponding resource-principal, the defined resource-principal will be utilized whenever the current identity is NOT matched elsewhere in the map.
This element is deprecated. Refer to the Programming the WebLogic J2EE Connector Architecture guide for more details. 
This is an optional element, however, it must be specified in some form if Container Managed Sign-on is supported by the Resource Adapter and used by ANY client.
In addition, the deployment-time population of the Connection Pool with Managed Connections will be attempted using the defined 'default' resource principal if one is specified.
-->
<!ELEMENT security-principal-map (map-entry*)>
<!ELEMENT map-entry (initiating-principal+, resource-principal)>
<!ELEMENT initiating-principal (#PCDATA)>
<!ELEMENT resource-principal (resource-username, resource-password)>
<!ELEMENT resource-username (#PCDATA)>
<!ELEMENT resource-password (#PCDATA)>

 


weblogic-ra. xml Element Hierarchy Diagram

The following diagram summarizes the structure of the weblogic-ra.xml deployment descriptor.

Figure 8-1 weblogic-ra.xml Element Hierarchy


 

 


weblogic-ra.xml Element Descriptions

The following sections describe each of the elements that can be defined in the weblogic-ra.xml file.

weblogic-connection-factory-dd (required)

The root element of the Weblogic-specific deployment descriptor for the deployed resource adapter.

connection-factory-name (required)

Defines the logical name that will be associated with this specific deployment of the resource adapter and its corresponding connection factory. The value of this element can be used in other deployed resource adapters through the ra-link-ref element, allowing multiple deployed Connection Factories to utilize a common deployed resource adapter, as well as share configuration specifications.

description (optional)

Provides text describing the parent element. This element should include any information that the deployer wants to describe about the deployed Connection Factory.

jndi-name (required)

Defines the name that will be used to bind the Connection Factory Object into the WebLogic JNDI Namespace. Client EJBs and Servlets use the same JNDI in their defined Reference Descriptor elements of the WebLogic-specific deployment descriptors.

ra-link-ref (optional)

Allows for the logical association of multiple deployed connection factories with a single deployed resource adapter. The specification of the optional ra-link-ref element with a value identifying a separately deployed connection factory will result in this newly deployed connection factory sharing the resource adapter that has been deployed with the referenced connection factory. In addition, any values defined in the referred connection factories deployment will be inherited by this newly deployed connection factory unless specified.

native-libdir (required if native libraries present)

Identifies the directory location to be used for all native libraries present in this resource adapter deployment. As part of deployment processing, all encountered native libraries will be copied to the location specified. It is the responsibility of the administrator to perform the necessary platform actions such that these libraries will be found during WebLogic Server run time.

pool-params (optional)

The root element for providing connection pool-specific parameters for this connection factory. WebLogic Server uses these specifications in controlling the behavior of the maintained pool of managed connections.

Failure to specify this element or any of its specific element items will result in default values being assigned. Refer to the description of each individual element for the designated default value.

initial-capacity (optional)

Identifies the initial number of managed connections, which WebLogic Server attempts to obtain during deployment.

Failure to specify this value will result in WebLogic Server using its defined default value.

Default Value: 1

max-capacity (optional)

Identifies the maximum number of managed connections, which WebLogic Server will allow. Requests for newly allocated managed connections beyond this limit results in a ResourceAllocationException being returned to the caller.

Failure to specify this value will result in WebLogic Server using its defined default value.

Default Value: 10

capacity-increment (optional)

Identifies the maximum number of additional managed connections that WebLogic Server attempts to obtain during resizing of the maintained connection pool.

Failure to specify this value will result in WebLogic Server using its defined default value.

Default Value: 1

shrinking-enabled (optional)

Indicates whether or not the connection pool should have unused managed connections reclaimed as a means to control system resources.

Failure to specify this value will result in WebLogic Server using its defined default value.

Value Range: true | false

Default Value: true

shrink-period-minutes (optional)

Identifies the amount of time the connection pool manager will wait between attempts to reclaim unused managed connections.

Failure to specify this value will result in WebLogic Server using its defined default value.

Default Value: 15

connection-cleanup-frequency (optional)

Identifies the amount of time the connection pool management will wait between attempts to destroy connection handles which have exceeded their usage duration. This element, used in conjunction with connection-duration-time, prevents connection leaks when an application may have not closed a connection after completing usage.

Failure to specify this value will result in Weblogic using its defined default value.

Default Value: -1

Note: The connection-cleanup-frequency element is a deprecated element. If you currently have this parameter in your configuration, you will still be able use deployment functions. However, this element will have no effect on the configuration.

connection-duration-time (optional)

This is a deprecated element.Identifies the amount of time a connection can be active. This element, used in conjunction with connection-cleanup-frequency, prevents leaks when an application may have not closed a connection after completing usage.

Failure to specify this value will result in Weblogic using its defined default value.

Default Value: -1

Note: The connection-duration-time element is a deprecated element. If you currently have this parameter in your configuration, you will still be able use deployment functions. However, this element will have no effect on the configuration.

connection-maxidle-time (optional)

Identifies the amount of time (in seconds) a connection handle can remain idle. This element prevents leaks when an application may have not closed a connection after completing usage. Idle connections will only be terminated in the case where the connection pool becomes full, and a new connection request is about to fail because of this.

Failure to specify this value will result in WebLogic Server using its defined default value.

Default Value: 0

connection-profiling-enabled (optional)

Indicates whether or not the connection pool should store the call stacks of where each connection is allocated. If enabled this information can be viewed on active connections through the Console. Also, the stacks for Leaked and Idle connections will be available if this is enabled and can help debug components that fail to close connections.

Failure to specify this value will result in Weblogic using its defined default value.

Value Range: true | false

Default Value: false

logging-enabled (optional)

Indicates whether or not the log writer is set for either the ManagedConnectionFactory or ManagedConnection. If this element is set to true, output generated from either the ManagedConnectionFactory or ManagedConnection will be sent to the file specified by the log-filename element.

Failure to specify this value will result in WebLogic Server using its defined default value.

Value Range: true | false

Default Value: false

log-filename (optional)

Specifies the name of the log file from which output generated from the ManagedConnectionFactory or a ManagedConnection is sent.

The full address of the filename is required.

map-config-property (optional, zero or more)

Identifies a configuration property name and value that corresponds to an ra.xml config-entry element with the corresponding config-property-name. At deployment time, all values present in a map-config-property specification will be set on the ManagedConnectionFactory. Values specified via a map-config-property will supersede any default value that may have been specified in the corresponding ra.xml config-entry element.

map-config-property-name (optional)

Identifies a name that corresponds to an ra.xml config-entry element with the corresponding config-property-name.

map-config-property-value (optional)

Identifies a value that corresponds to an ra.xml config-entry element with the corresponding config-property-name.

security-principal-map (optional)

(This is a deprecated element.) Provides a mechanism to define appropriate resource-principal values for resource adapter and EIS authorization processing, based upon the known WebLogic run time initiating-principal. This map allows for the specification of a defined set of initiating principals and the corresponding resource principal's username and password that should be used when allocating managed connections and connection handles.

A default resource-principal can be defined for the connection factory via the map. By specifying an initiating-principal value of `*' and a corresponding resource-principal, the defined resource-principal will be utilized whenever the current identity is not matched elsewhere in the map.

This is an optional element, however, it must be specified in some form if container managed sign-on is supported by the resource adapter and used by any client.

In addition, the deployment-time population of the connection pool with managed connections will be attempted using the defined `default' resource principal if one is specified.

map-entry

Identifies an entry in the security-principal-map.

 

Back to Top Previous Next