Developing WebLogic Server Applications

 Previous Next Contents Index View as PDF  

Application Deployment Descriptor Elements

The following sections describe deployment descriptors for J2EE applications on ProductName. Two deployment descriptors are required: a J2EE standard deployment descriptor named application.xml, and a WebLogic-specific application deployment descriptor named weblogic-application.xml. The weblogic-application.xml file is optional if you are not using any WebLogic Server extensions.

 


application.xml Deployment Descriptor Elements

The following sections describe the application.xml file.

The application.xml file is the deployment descriptor for Enterprise Application Archives. The file is located in the META-INF subdirectory of the application archive. It must begin with the following DOCTYPE declaration:

<!DOCTYPE application PUBLIC "-//Sun Microsystems, 
Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">

The following diagram summarizes the structure of the application.xml deployment descriptor.


 

The following sections describe each of the elements that can appear in the file.

 


application

application is the root element of the application deployment descriptor. The elements within the application element are described in the following sections.

icon

Optional. The icon element specifies the locations of small and large images that represent the application in a GUI tool. This element is not currently used by WebLogic Server.

small-icon

Optional. Specifies the location for a small (16x16 pixel) .gif or .jpg image used to represent the application in a GUI tool. Currently, this is not used by WebLogic Server.

large-icon

Optional. Specifies the location for a large (32x32 pixel) .gif or .jpg image used to represent the application in a GUI tool. Currently, this element is not used by WebLogic Server.

display-name

The display-name element specifies the application display name, a short name that is intended to be displayed by GUI tools.

description

The optional description element provides descriptive text about the application.

module

The application.xml deployment descriptor contains one module element for each module in the Enterprise Archive file. Each module element contains an ejb, java, or web element that indicates the module type and location of the module within the application. An optional alt-dd element specifies an optional URI to the post-assembly version of the deployment descriptor.

alt-dd

Specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular J2EE module. The URI must specify the full pathname of the deployment descriptor file relative to the application's root directory. If you do not specify alt-dd, the deployer must read the deployment descriptor from the default location and file name required by the respective component specification.

connector

Specifies the URI of a resource adapter (connector) archive file, relative to the top level of the application package.

ejb

Defines an EJB module in the application file. Contains the path to an EJB JAR file in the application.

Example:

<ejb>petStore_EJB.jar</ejb>

java

Defines a client application module in the application file.

Example:

<java>client_app.jar</java>

web

Defines a Web application module in the application.xml file. The web element contains a web-uri element and a context-root element. If you do not declare a value for the context-root, then the basename of the web-uri element is used as the context path of the Web application. (Note that the context path must be unique in a given Web server. More than one Web application may be using the same Web server, so you must avoid having context path clashes across multiple applications.)

web-uri

Defines the location of a Web module in the application.xml file. This is the name of the WAR file.

context-root

Specifies a context root for the Web application.

Example:

<web>
  <web-uri>petStore.war</web-uri>
  <context-root>estore</context-root>
</web>

security-role

The security-role element contains the definition of a security role which is global to the application. Each security-role element contains an optional description element, and a role-name element.

description

Optional. Text description of the security role.

role-name

Defines the name of a security role or principal that is used for authorization within the application. Roles are mapped to ProductName users or groups in the weblogic-application.xml deployment descriptor.

Example:

<security-role>
  <description>the gold customer role</description>
  <role-name>gold_customer</role-name>
</security-role>
<security-role>
  <description>the customer role</description>
  <role-name>customer</role-name>
</security-role>

 


weblogic-application.xml Deployment Descriptor Elements

The following sections describe the weblogic-application.xml file. The weblogic-application.xml file is the BEA WebLogic Server-specific deployment descriptor extension for the application.xml deployment descriptor from Sun Microsystems. This is where you configure features such as application-scoped JDBC Pools and EJB Caching.

The file is located in the META-INF subdirectory of the application archive. It must begin with the following DOCTYPE declaration:

<!DOCTYPE weblogic-application PUBLIC "-//BEA Systems, Inc.//DTD WebLogic Application 7.0.0//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic-application_1_0.dtd;">

The following sections describe each element that can appear in the file.

 


weblogic-application

The weblogic-application element is the root element of the application deployment descriptor.

ejb

Optional. The ejb element contains information that is specific to the EJB modules that are part of a WebLogic application. Currently, one can use the ejb element to specify one or more application level caches that can be used by the application's entity beans.

entity-cache

One or more. The entity-cache element is used to define a named application level cache that is used to cache entity EJB instances at runtime. Individual entity beans refer to the application-level cache that they must use, referring to the cache name. There is no restriction on the number of different entity beans that may reference an individual cache.

Application-level caching is used by default whenever an entity bean does not specify its own cache in the weblogic-ejb-jar.xml descriptor. Two default caches named ExclusiveCache and MultiVersionCache are used for this purpose. An application may explicitly define these default caches to specify non-default values for their settings. Note that the caching-strategy cannot be changed for the default caches. By default, a cache uses max-beans-in-cache with a value of 1000 to specify its maximum size.

Example:

<entity-cache> 
	<entity-cache-name>ExclusiveCache</entity-cache-name> 
	<max-cache-size> 
		<megabytes>50</megabytes> 
	</max-cache-size> 
</entity-cache>

entity-cache-name

The entity-cache-name element specifies a unique name for an entity bean cache. The name must be unique within an ear file and may not be the empty string.

Example:

<entity-cache-name>ExclusiveCache</entity-cache-name>

max-beans-in-cache

Optional. The max-beans-in-cache element specifies the maximum number of entity beans that are allowed in the cache. If the limit is reached, beans may be passivated. This mechanism does not take into account the actual amount of memory that different entity beans require. This element can be set to a value of 1 or greater.

Default Value: 1000

max-cache-size

The max-cache-size element is used to specify a limit on the size of an entity cache in terms of memory size—expressed either in terms of bytes or megabytes. A bean provider should provide an estimate of the average size of a bean in the weblogic-ejb-jar.xml descriptor if the bean uses a cache that specifies its maximum size using the max-cache-size element. By default, a bean is assumed to have an average size of 100 bytes.

caching-strategy

Optional. The caching-strategy element specifies the general strategy that the EJB container uses to manage entity bean instances in a particular application level cache. A cache buffers entity bean instances in memory and associates them with their primary key value.

The caching-strategy element can only have one of the following values:

Default Value: MultiVersion

Example:

<caching-strategy>Exclusive</caching-strategy>

start-mdbs-with-application

Optional. Allows you to configure the EJB container to start Message Driven BeanS (MDBS) with the application. If set to true, the container starts MDBS as part of the application. If set to false, the container keeps MDBS in a queue and the server starts them as soon as it has started listening on the ports.

xml

Optional. The xml element contains information about parsers and entity mappings for XML processing that is specific to this application.

parser-factory

Optional. The parser-factory element contains three elements: saxparser-factory?, document-builder-factory?, and transformer-factory?.

saxparser-factory

Optional. The saxparser-factory element allows you to set the SAXParser Factory for the XML parsing required in this application only. This element determines the factory to be used for SAX style parsing. If you do not specify the saxparser-factory element setting, the configured SAXParser Factory style in the Server XML Registry is used.

Default Value: Server XML Registry setting

document-builder-factory

Optional. The document-builder-factory element allows you to set the Document Builder Factory for the XML parsing required in this application only. This element determines the factory to be used for DOM style parsing. If you do not specify the document-builder-factory element setting, the configured DOM style in the Server XML Registry is used.

Default Value: Server XML Registry setting

transformer-factory

Optional. The transformer-factory element allows you to set the Transformer Engine for the style sheet processing required in this application only. If you do not specify a value for this element, the value configured in the Server XML Registry is used.

Default value: Server XML Registry setting.

entity-mapping

Zero or more. The entity-mapping element is used to specify entity mapping. This mapping determines the alternative entity URI for a given public or system ID. The default place to look for this entity URI is the lib/xml/registry directory.

entity-mapping-name

The entity-mapping-name element specifies the name for this entity mapping.

public-id

Optional. The public-id element specifies the public ID of the mapped entity.

system-id

Optional. The system-id element specifies the system ID of the mapped entity.

entity-uri

Optional. The entity-uri element specifies the entityuri for the mapped entity.

when-to-cache

Optional. Legal values are:

The default value is cache-on-reference.

cache-timeout-interval

Optional. The cache-timeout-interval element allows you to specify the integer value in seconds.

jdbc-connection-pool

Zero or more. The jdbc-connection-pool element specifies an application-scoped JDBC connection pool.

data-source-name

The data-source-name element specifies the JNDI name in the application-specific JNDI tree.

connection-factory

The connection-factory element defines the number of physical database connections to create when the pool is initialized. The default value is 1.

factory-name

The factory-name element specifies the name of a JDBCDataSourceFactoryMBean in the config.xml file.

connection-properties

Optional. The connection-properties element specifies the connection parameters that define overrides for default connection factory settings.

pool-params

Optional. The pool-params element defines parameters that affect the behavior of the pool.

size-params

Optional. The size-params element defines parameters that affect the number of connections in the pool.

xa-params

Optional. The xa-params element defines the parameters for the XA DataSources.

login-delay-seconds

Optional. Integer value. The login-delay-seconds element sets the number of seconds to delay before creating each physical database connection. Some database servers cannot handle multiple requests for connections in rapid succession. This property allows you to build in a small delay to let the database server catch up. This delay occurs both during initial pool creation and during the lifetime of the pool whenever a physical database connection is created.

leak-profiling-enabled

Optional. The leak-profiling-enabled element enables JDBC connection leak profiling. A connection leak occurs when a connection from the pool is not closed explicitly by calling the close() method on that connection. When connection leak profiling is active, the pool stores the stack trace at the time the connection object is allocated from the pool and given to the client. When a connection leak is detected (when the connection object is garbage collected), this stack trace is reported.

This element uses extra resources and will likely slowdown connection pool operations, so it is not recommended for production use.

connection-check-params

Optional. The connection-check-params element defines whether, when, and how connections in a pool is checked to make sure they are still alive.

driver-params

Optional. The driver-params element sets behavior on WebLogic Server drivers.

statement

Optional.

prepared-statement

Optional. profiling-enabled boolean. The prepared-statement element enables the running of JDBC prepared statement cache profiling. When enabled, prepared statement cache profiles are stored in external storage for further analysis. This is a resource-consuming feature, so it is recommended that you turn it off on a production server. The default value is false.

row-prefetch-enabled

Optional

row-prefetch-size

Optional

stream-chunk-size

Optional

acl-name

Optional

application-param

Zero or more. The application-param element defines various parameters that affect container behavior. These parameters are as follows:

 

Back to Top Previous Next