BEA Logo BEA WebLogic Server Release 6.1

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

  |  

  WebLogic Server Doc Home   |     Programming WebLogic EJB   |   Previous Topic   |   Next Topic   |   Contents   |   View as PDF

weblogic-ejb-jar.xml Document Type Definitions

 

The following sections describe the EJB 5.1 and EJB 6.0 deployment descriptor elements found in the weblogic-ejb-jar.xml file, the weblogic-specific XML document type definitions (DTD) file. Use these definitions to create the WebLogic-specific weblogic-ejb-jar.xml file that is part of your EJB deployment.

Note: Use the 6.0 deployment descriptors with the 6.x version of WebLogic Server.

 


EJB Deployment Descriptors

The EJB deployment descriptors contain structural and application assembly information for an enterprise bean. You specify this information by specifying values for the deployment descriptors in three EJB XML DTD files. These files are:

You package these three XML files with the EJB and other classes into a deployable EJB component, usually a JAR file, called ejb.jar.

The ejb-jar.xml file is based on the deployment descriptors found in Sun Microsystems's ejb.jar.xml file. The other two XML files are weblogic-specific files that are based on the deployment descriptors found in weblogic-ejb-jar.xml and weblogic-cmp-rdbms-jar.xml.

 


DOCTYPE Header Information

When you edit or create XML deployment files, it is critical to include the correct DOCTYPE header for the 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 correct text for the PUBLIC elements for the WebLogic Server-specific weblogic-ejb-jar.xml file are as follows.

XML File

PUBLIC Element String

weblogic-ejb-jar.xml

`-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN` `http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd`

weblogic-ejb-jar.xml

`-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN'

`http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'

The correct text for the PUBLIC elements for the Sun Microsystem-specific ejb-jar.xml file are as follows.

XML File

PUBLIC Element String

ejb-jar.xml

`-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' `

ejb-jar.xml

`-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN'

`http://www.java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'

For example, the entire DOCTYPE header for a weblogic-ejb-jar.xml file is as follows:

<!DOCTYPE weblogic-ejb-jar PUBLIC 
'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN' 
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.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. WebLogic Server ignores the DTDs embedded within the DOCTYPE header of XML deployment files, and instead uses 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.

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.

weblogic-ejb-jar.xml

The following links provide the new public DTD locations for the weblogic-ejb-jar.xml deployment files used with the WebLogic Server:

ejb-jar.xml

The following links provide the public DTD locations for the ejb-jar.xml deployment files used with WebLogic Server:

Note: Refer to the appropriate JavaSoft EJB specification for a description of the ejb-jar.xml deployment descriptors.

 


Changed EJB Deployment Elements in WebLogic Server 6.1

These changes were made to weblogic-ejb-jar.xml in WebLogic Server 6.1:

 


6.0 weblogic-ejb-jar.xml Deployment Descriptor File Structure

The WebLogic Server 6.0 weblogic-ejb-jar.xml deployment descriptor file describes the elements that are unique to WebLogic Server. Although you can use both versions of the deployment descriptors in the EJB container, the WebLogic Server 6.0 version of weblogic-ejb-jar.xml is different from the version shipped with WebLogic Server Version 5.1.

The WebLogic Serve 6.0 weblogic-ejb-jar.xml includes elements for enabling stateful session EJB replication, configuring entity EJB locking behavior, and assigning JMS Queue and Topic names for message-driven beans.

The top level elements in the WebLogic Server 6.0 weblogic-ejb-jar.xml are as follows:

 


6.0 weblogic-ejb-jar.xml Deployment Descriptor Elements

 


allow-concurrent-calls

Range of values:

true | false

Default value:

false

Requirements:

Requires the server to throw a RemoteException when a stateful session bean instance is currently handling a method call and another (concurrent) method call arrives on the server.

Parent elements:

weblogic-enterprise-bean

stateful-session-descriptor

Function

The allow-concurrent-calls element specifies whether a stateful session bean instance allows concurrent method calls. By default, allows-concurrent-calls is false. However, when this value is set to true, the EJB container blocks the concurrent method call and allows it to proceed when the previous call has completed.

Example

See stateful-session-descriptor.

 


cache-type

Range of values:

NRU | LRU

Default value:

NRU

Requirements:


Parent elements:

weblogic-enterprise-bean

stateful-session-cache

Function

The cache-type element specifies the order in which EJBs are removed from the cache. The values are:

Example

The following example shows the structure of the cache-type element.

<stateful-session-cache> 
<cache-type>NRU</cache-type>
</stateful-session-cache>

 


connection-factory-jndi-name

Range of values:

valid name

Default value:

weblogic.jms.MessageDrivenBeanConnectionFactory in config.xml

Requirements:

Requires the server to throw a RemoteException when a stateful session bean instance is currently handling a method call and another (concurrent) method call arrives on the server.

Parent elements:

weblogic-enterprise-bean
message-driven-descriptor

Function

The connection-factory-jndi-name element specifies the JNDI name of the JMS Connection Factory that the message-driven bean should look up to create its queues and topics. If this element is not specified, the default is the weblogic.jms.MessageDrivenBeanConnectionFactory in config.xml.

Example

<message-driven-descriptor>
      <connection-factory-jndi-name>weblogic.jms.MessageDrivenBean
        ConnectionFactory</connection-factory-jndi-name>
</message-driven-descriptor>

 


concurrency-strategy

Range of values:

Exclusive | Database | ReadOnly

Default value:

Database

Requirements:

Optional element. Valid only for entity EJBs.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
entity-cache

Function

The concurrency-strategy element specifies how the container should manage concurrent access to an entity bean. Set this element to one of three values:

SeeLocking Services for Entity EJBs for more information on the Exclusive and Database locking behaviors. SeeRead-Only Multicast Invalidation for more information about read-only entity EJBs.

Example

The following entry identifies the AccountBean class as a read-only entity EJB:

<weblogic-enterprise-bean>
	<ejb-name>AccountBean</ejb-name>
	<entity-descriptor>
		<entity-cache>
			
<concurrency-strategy>ReadOnly</concurrency-strategy>
		</entity-cache>
	</entity-descriptor>
</weblogic-enterprise-bean>

 


db-is-shared

Range of values:

true | false

Default value:

true

Requirements:

Optional element. Valid only for entity EJBs.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
persistence

Function

The db-is-shared element applies only to entity beans. When it is set to true, WebLogic Server assumes that EJB data can be modified between transactions and reloads the data at the beginning of each transaction. When set to false, WebLogic Server assumes that it has exclusive access to the EJB data in the persistent store. See Using db-is-shared to Limit Calls to ejbLoad() for more information.

Example

See persistence.

 


delay-updates-until-end-of-tx

Range of values:

true | false

Default value:

true

Requirements:

Optional element. Valid only for entity EJBs.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
persistence

Function

Set the delay-updates-until-end-of-tx element to true (the default) to update the persistent store of all beans in a transaction at the completion of the transaction. This setting generally improves performance by avoiding unnecessary updates. However, it does not preserve the ordering of database updates within a database transaction.

If your datastore uses an isolation level of TRANSACTION_READ_UNCOMMITTED, you may want to allow other database users to view the intermediate results of in-progress transactions. In this case, set delay-updates-until-end-of-tx to false to update the bean's persistent store at the conclusion of each method invoke. See ejbLoad() and ejbStore() Behavior for Entity EJBs for more information.

Note: Setting delay-updates-until-end-of-tx to false does not cause database updates to be "committed" to the database after each method invoke; they are only sent to the database. Updates are committed or rolled back in the database only at the conclusion of the transaction.

Example

The following example shows a delay-updates-until-end-of-tx stanza.

<entity-descriptor>
	<persistence>
		
<delay-updates-until-end-of-tx>false</delay-updates-until-end-of-
tx>
	</persistence>
</entity-descriptor>

 


description

Range of values:

n/a

Default value:

n/a

Requirements:

n/a

Parent elements:

weblogic-ejb-jar
transaction-isolation
method

Function

The description element is used to provide text that describes the parent element.

Example

The following examples specifies the description element.

 


destination-jndi-name

Range of values:

Valid JNDI name

Default value:

n/a

Requirements:

Required in message-driven-descriptor.

Parent elements:

weblogic-enterprise-bean
message-driven-descriptor

Function

The destination-jndi-name element specifies the JNDI name used to associate a message-driven bean with an actual JMS Queue or Topic deployed in the in WebLogic Server JNDI tree.

Example

See message-driven-descriptor.

 


ejb-name

Range of values:

Name of an EJB defined in ejb-jar.xml

Default value:

n/a

Requirements:

Required element in method stanza. The name must conform to the lexical rules for an NMTOKEN.

Parent elements:

weblogic-enterprise-bean
method

Function

ejb-name specifies the name of an EJB to which WebLogic Server applies isolation level properties. This name is assigned by the ejb-jar file's deployment descriptor. The name must be unique among the names of the enterprise beans in the same ejb.jar file. The enterprise bean code does not depend on the name; therefore the name can be changed during the application-assembly process without breaking the enterprise bean's function. There is no built-in relationship between the ejb-name in the deployment descriptor and the JNDI name that the deployer will assign to the enterprise bean's home.

Example

See method.

 


ejb-reference-description

Range of values:

n/a (XML stanza)

Default value:

n/a (XML stanza)

Requirements:

Optional element.

Parent elements:

weblogic-enterprise-bean
reference-descriptor

Function

The ejb-reference-description element maps the JNDI name in the WebLogic Server of an EJB that is referenced by the bean in the ejb-reference element.

Example

The ejb-reference-description stanza is shown here:

<ejb-reference-description>
	<ejb-ref-name>AdminBean</ejb-ref-name>
		<jndi-name>payroll.AdminBean</jndi-name>
	</ejb-reference-description>

 


ejb-ref-name

Range of values:

n/a

Default value:

n/a

Requirements:

Optional element.

Parent elements:

weblogic-enterprise-bean
reference-description
ejb-reference-description

Function

The ejb-ref-name element specifies a resource reference name. This element is the reference that the EJB provider places within the ejb-jar.xml deployment file.

Example

The ejb-ref-name stanza is shown here:

<reference-descriptor>
	<ejb-reference-description>
		<ejb-ref-name>AdminBean</ejb-ref-name>
		<jndi-name>payroll.AdminBean</jndi-name>
	</ejb-reference-description>
</reference-descriptor>

 


ejb-local-reference-description

Range of values:

n/a (XML stanza)

Default value:

n/a (XML stanza)

Requirements:

Optional element.

Parent elements:

weblogic-enterprise-bean
reference-descriptor

Function

The ejb-local-reference-description element maps the JNDI name of an EJB in the WebLogic Server that is referenced by the bean in the ejb-local ref element.

Example

The following example shows the ejb-local-reference-description element.

<ejb-local-reference-description>
	<ejb-ref-name>AdminBean</ejb-ref-name>
	<jndi-name>payroll.AdminBean</jndi-name>
</ejb-local-reference-description>

 


enable-call-by-reference

Range of values:

true | false

Default value:

true

Requirements:

Optional element.

Parent elements:

weblogic-enterprise-bean
reference-descriptor

ejb-reference-description

Function

By default, EJB methods called from within the same EAR pass arguments by reference. This increases the performance of method invocation because parameters are not copied.

If you set enable-call-by-reference to False, parameters to the EJB methods are copied (pass-by-value) in accordance with the EJB 1.1 specification. Pass by value is always necessary when the EJB is called remotely (not from within the same application).

Example

The following example enables pass-by-value for EJB methods:

<weblogic-enterprise-bean>
	<ejb-name>AccountBean</ejb-name>
	...
	<enable-call-by-reference>false</enable-call-by-reference>
</weblogic-enterprise-bean>

 


entity-cache

Range of values:

n/a (XML stanza)

Default value:

n/a (XML stanza)

Requirements:

The entity-cache stanza is optional, and is valid only for entity EJBs.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor

Function

The entity-cache element defines the following options used to cache entity EJB instances within WebLogic Server:

See EJB Life Cycle for a general discussion of the caching services available in WebLogic Server.

Example

<entity-descriptor>
	<entity-cache>
		<max-beans-in-cache>...</max-beans-in-cache>
		<idle-timeout-seconds>...</idle-timeout-seconds>
		<read-timeout-seconds>...<read-timeout-seconds>
		<concurrency-strategy>...</concurrency-strategy>
	</entity-cache>
	<lifecycle>...</lifecycle>
	<persistence>...</persistence>
	<entity-clustering>...</entity-clustering>
</entity-descriptor>

 


entity-clustering

Range of values:

n/a (XML stanza)

Default value:

n/a (XML stanza)

Requirements:

Optional element. Valid only for entity EJBs in a cluster.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor

Function

The entity-clustering element uses the following options to specify how an entity bean will be replicated in a WebLogic cluster:

Example

The following excerpt shows the structure of a entity-clustering stanza:

<entity-clustering>
	<home-is-clusterable>true</home-is-clusterable>
	<home-load-algorithm>random</home-load-algorithm>
	
<home-call-router-class-name>beanRouter</home-call-router-class-n
ame>
</entity-clustering>

 


entity-descriptor

Range of values:

n/a (XML stanza)

Default value:

n/a (XML stanza)

Requirements:

One entity-descriptor stanza is required for each entity EJB in the .jar.

Parent elements:

weblogic-enterprise-bean

Function

The entity-descriptor element specifies the following deployment parameters that are applicable to an entity bean:

Example

The following example shows the structure of the entity-descriptor stanza:

<entity-descriptor>
	<entity-cache>...</entity-cache>
	<lifecycle>...</lifecycle>
	<persistence>...</persistence>
	<entity-clustering>...</entity-clustering>
</entity-descriptor>

 


finders-load

Range of values:

true | false

Default value:

true

Requirements:

Optional element. Valid only for CMP entity EJBs.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
persistence

-bean

Function

The finders-load-bean element determines whether WebLogic Server loads the EJB into the cache after a call to a finder method returns a reference to the bean. If you set this element to true, WebLogic Server immediately loads the bean into the cache if a reference to a bean is returned by the finder. If you set this element to false, WebLogic Server does not load automatically load the bean into the cache until the first method invocation; this behavior is consistent with the EJB 1.1 specification.

Example

The following entry specifies that EJBs are loaded into the WebLogic Server cache automatically when a finder method returns a reference to the bean:

<entity-descriptor>
	<persistence>
		<finders-load-bean>true</finders-load-bean>
	</persistence>
</entity-descriptor>

 


home-call-router-class-name

Range of values:

Valid router class name

Default value:

null

Requirements:

Optional element. Valid only for entity EJBs, stateful session EJBs, and stateless session EJBs in a cluster.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
entity-clustering

and

weblogic-enterprise-bean
stateful-session-descriptor
stateful-session-clustering

Function

home-call-router-class-name specifies the name of a custom class to use for routing bean method calls. This class must implement weblogic.rmi.cluster.CallRouter(). If specified, an instance of this class is called before each method call. The router class has the opportunity to choose a server to route to based on the method parameters. The class returns either a server name or null, which indicates that the current load algorithm should select the server.

Example

See entity-clustering and stateful-session-clustering.

 


home-is-clusterable

Range of values:

true | false

Default value:

true

Requirements:

Optional element. Valid for entity EJBs, stateless session EJBs, and stateful session EJBs in a cluster.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
entity-clustering

and

weblogic-enterprise-bean
stateful-session-descriptor
stateful-session-clustering

and

weblogic-enterprise-bean
stateless-session-descriptor
stateless-clustering

Note: This element is valid for stateless session EJBs as of WebLogic Server 6.1 SP03.

Function

Use home-is-clusterable to specify whether the home interface of an entity, stateless session, or stateful session bean is clustered.

When home-is-clusterable is true for an EJB deployed to a cluster, each server instance binds the bean's home interface to its cluster JNDI tree under the same name. When a client requests the bean's home from the cluster, the server instance that does the look-up returns a EJBHome stub that has a reference to the home on each server.

When the client issues a create() or find() call, the stub routes selects a server from the replica list in accordance with the load balancing algorithm, and routes the call to the home interface on that server. The selected home interface receives the call, and creates a bean instance on that server instance and executes the call, creating an instance of the bean.

Example

See entity-clustering.

 


home-load-algorithm

Range of values:

round-robin | random | weight-based

Default value:

Value of weblogic.cluster.defaultLoadAlgorithm

Requirements:

Optional element. Valid only for entity EJBs and stateful session EJBs in a cluster.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
entity-clustering

and

weblogic-enterprise-bean
stateful-session-descriptor
stateful-session-clustering

Function

home-load-algorithm specifies the algorithm to use for load balancing between replicas of the EJB home. If this property is not defined, WebLogic Server uses the algorithm specified by the server property, weblogic.cluster.defaultLoadAlgorithm.

You can define home-load-algorithm as one of the following values:

Example

See entity-clustering and stateful-session-clustering.

 


idle-timeout-seconds

Range of values:

1 to maxSeconds, where maxSeconds is the maximum value of an int.

Default value:

600

Requirements:

Optional element

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
entity-cache

and

weblogic-enterprise-bean,
stateful-session-descriptor,
stateful-session-cache

Function

idle-timeout-seconds defines the maximum length of time a stateful session EJB should remain in cache. After this time has elapsed, WebLogic Server removes the bean instance if the number of beans in cache approaches the limit of max-beans-in-cache. The removed bean instances are passivated. See EJB Life Cycle for more information.

Note: Although idle-timeout-seconds appears in the entity-cache stanza, WebLogic Server 6. 1 does not uses its value in managing the lifecycle of entity EJBs— idle-timeout-seconds has no effect on when entity beans are removed from cache.

Example

The following entry indicates that the stateful session EJB, AccountBean, should become eligible for removal if max-beans-in-cache is reached and the bean has been in cache for 20 minutes:

<weblogic-enterprise-bean>
	<ejb-name>AccountBean</ejb-name>
	<stateful-session-descriptor>
		<stateful_session-cache>
			<max-beans-in-cache>200</max-beans-in-cache>
			
<idle-timeout-seconds>1200</idle-timeout-seconds>
		</stateful-session-cache>
	</stateful-session-descriptor>
</weblogic-enterprise-bean>

 


initial-beans-in-free-pool

Range of values:

0 to maxBeans

Default value:

0

Requirements:

Optional element. Valid for stateless session, entity, and message-driven EJBs.

Parent elements:

weblogic-enterprise-bean,

stateless-session-descriptor, message-bean-descriptor, entity-descriptor
pool

Function

If you specify a value for initial-beans-in-free-pool, you set the initial size of the pool. WebLogic Server populates the free pool with the specified number of bean instances for every bean class at startup. Populating the free pool in this way improves initial response time for the EJB, because initial requests for the bean can be satisfied without generating a new instance.

Example

See pool.

 


initial-context-factory

Range of values:

true | false

Default value:

weblogic.jndi.WLInitialContextFactory

Requirements:

Requires the server to throw a RemoteException when a stateful session bean instance is currently handling a method call and another (concurrent) method call arrives on the server.

Parent elements:

weblogic-enterprise-bean

message-driven-descriptor

Function

The initial-context-factory element specifies the initial contextFactory that the container will use to create its connection factories. If initial-context-factory is not specified, the default will be weblogic.jndi.WLInitialContextFactory.

Example

The following example specifies the initial-context-factory element.

<message-driven-descriptor>
<initial-context-factory>weblogic.jndi.WLInitialContextFactory
</initial-context-factory>
</message-driven-descriptor>

 


invalidation-target

Range of values:


Default value:


Requirements:

The target ejb-name must be a Read-Only entity EJB and this element can only be specified for an EJB 2.0 container-managed persistence entity EJB.

Parent elements:

weblogic-enterprise-bean

entity-descriptor

Function

The invalidation-target element specifies a Read-Only entity EJB that should be invalidated when this container-managed persistence entity EJB has been modified.

Example

The following entry specifies that the EJB named StockReaderEJB should be invalidated when the EJB has been modified.

<invalidation-target>
	<ejb-name>StockReaderEJB</ejb-name>
</invalidation-target>

 


is-modified-method-name

Range of values:

Valid entity EJB method name

Default value:

None

Requirements:

Optional element. Valid only for entity EJBs.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
persistence

Function

is-modified-method-name specifies a method that WebLogic Server calls when the EJB is stored. The specified method must return a boolean value. If no method is specified, WebLogic Server always assumes that the EJB has been modified and always saves it.

Providing a method and setting it as appropriate can improve performance for EJB 1.1-compliant beans, and for beans that use bean-managed persistence. However, any errors in the method's return value can cause data inconsistency problems. SeeUsing is-modified-method-name to Limit Calls to ejbStore() (EJB 1.1 Only) for more information.

Note: isModified() is no longer required for 2.0 CMP entity EJBs based on the EJB 2.0 specification However, it still applies to BMP and 1.1 CMP EJBs. When you deploy EJB 2.0 entity beans with container-managed persistence, WebLogic Server automatically detects which EJB fields have been modified, and writes only those fields to the underlying datastore.

Example

The following entry specifies that the EJB method named semidivine will notify WebLogic Server when the EJB has been modified:

<entity-descriptor>
	<persistence>
		
<is-modified-method-name>semidivine</is-modified-method-name>
	</persistence>
</entity-descriptor>

 


isolation-level

Range of values:

Serializable | ReadCommitted | ReadUncommitted | RepeatableRead

Default value:

n/a

Requirements:

Optional element.

Parent elements:

weblogic-ejb-jar
transaction-isolation

Function

isolation-level specifies the isolation level for all of the EJB's database operations. The following are possible values for isolation-level:

Refer to your database documentation for more information on the implications and support for different isolation levels.

Example

See transaction-isolation.

 


jms-client-id

Range of values:

N/A

Default value:

ejb name for the ejb

Requirements:

Necessary for durable subscriptions to JMS topics.

Parent elements:

weblogic-enterprise-bean

Function

The jms-client-id element specifies the client ID associated with the message-driven bean. This ID is necessary for durable subscriptions to JMS topics.

The JMS specification allows JMS consumers to specify an associated ID. A message-driven bean with a durable subscription needs an associated client ID. If you use a separate connection factory, you can set the client ID on the connection factory. In this case, the message-driven bean uses this client ID.

If the associated client ID does not have a client ID or if you are using the default connection factory, the message-driven bean uses the jms-client-id value as its client ID.

Example

The following example specifies the use of the jms-client-id element.

<jms-client-id>MyClientID</jms-client-id>

 


jms-polling-interval-seconds

Range of values:

none

Default value:

10 seconds

Requirements:

.none

Parent elements:

weblogic-enterprise-bean

Function

The jms-polling-interval-seconds element determines the number of seconds between each attempt by WebLogic Server to reconnect to the JMS destination.

Each message-driven bean listens on an associated JMS destination. If the JMS destination is located on another WebLogic Server instance or a foreign JMS provider, the JMS destination may become unreachable. In this case, the EJB container automatically attempts to reconnect to the JMS server. Once the JMS server is running again the message-driven bean can again receive JMS messages.

Refer to your database documentation for more information on the implications and support for different isolation levels.

Example

The following example specifies the use of the jms-polling-interval-seconds element.

<jms-polling-interval-seconds>5</jms-polling-interval-seconds>

 


jndi-name

Range of values:

Valid JNDI name

Default value:

n/a

Requirements:

Required in resource-description and ejb-reference-description.

Parent elements:

weblogic-enterprise-bean

and

weblogic-enterprise-bean
reference-descriptor
resource-description

and

weblogic-enterprise-bean
reference-descriptor
ejb-reference-description

Function

jndi-name specifies the JNDI name of an actual EJB, resource, or reference available in WebLogic Server.

Example

See resource-description and ejb-reference-description.

 


local-jndi-name

Range of values:

Valid JNDI name

Default value:

n/a

Requirements:

Required if the bean has a local home.

Parent elements:

weblogic-enterprise-bean

Function

The local-jndi-name element specifies a jndi-name for a bean's local home. If a bean has both a remote and a local home, then it must have two JNDI names; one for each home.

Example

The following example shows the specifies the local-jndi-name element.

<local-jndi-name>weblogic.jndi.WLInitialContext
</local-jndi-name>

 


lifecycle

Range of values:

n/a (XML stanza)

Default value:

n/a (XML stanza)

Requirements:

The lifecycle stanza is optional.

Parent elements:

weblogic-enterprise-bean,
entity-descriptor

and

weblogic-enterprise-bean

stateful-session-descriptor

Function

The lifecycle element defines options that affect the lifecycle of stateful and entity EJB instances within WebLogic Server. Currently, the lifecycle element includes only one element: passivation-strategy.

Example

The following example shows the specifies the lifecycle element.

<entity-descriptor>
	<lifecycle>
		<passivation-strategy>...</passivation-strategy>
	</lifecycle>
</entity-descriptor>

 


max-beans-in-cache

Range of values:

1 to maxBeans

Default value:

1000

Requirements:

Optional element

Parent elements:

weblogic-enterprise-bean,
entity-descriptor,
entity-cache

and

weblogic-enterprise-bean
stateful-session-descriptor
stateful-session-cache

Function

The max-beans-in-cache element specifies the maximum number of objects of this class that are allowed in memory. When max-bean-in-cache is reached, WebLogic Server passivates some EJBs that have not been recently used by a client. max-beans-in-cache also affects when EJBs are removed from the WebLogic Server cache, as described inLocking Services for Entity EJBs.

Example

The following entry enables WebLogic Server to cache a maximum of 200 instances of the AccountBean class:

<weblogic-enterprise-bean>
	<ejb-name>AccountBean</ejb-name>
	<entity-descriptor>
		<entity-cache>
			<max-beans-in-cache>200</max-beans-in-cache>
		</entity-cache>
	</entity-descriptor>
</weblogic-enterprise-bean>

 


max-beans-in-free-pool

Range of values:

0 to maxBeans

Default value:

1000

Requirements:

Optional element.

Parent elements:

weblogic-enterprise-bean,
stateless-session-descriptor,
pool

weblogic-enterprise-bean,
message-driven-descriptor,
pool

weblogic-enterprise-bean,
entity-descriptor,
pool

Function

WebLogic Server maintains a free pool of EJBs for every stateless session, message-driven, and entity bean class max-beans-in-free-pool limits the size of the free pool. For more information, see EJB Life Cycle.

Example

See pool.

 


message-driven-descriptor

Range of values:

n/a (XML stanza)

Default value:

n/a (XML stanza)

Requirements:


Parent elements:

weblogic-enterprise-bean

Function

The message-driven-descriptor element associates a message-driven bean with a JMS destination in WebLogic Server. This element specifies the following deployment parameters:

Example

The following example shows the structure of the message-driven-descriptor stanza:

<message-driven-descriptor>
	<destination-jndi-name>...</destination-jndi-name>
</message-driven-descriptor>

 


method

Range of values:

n/a (XML stanza)

Default value:

n/a (XML stanza)

Requirements:

Optional element. You can specify more than one method stanza to configure multiple EJB methods.

Parent elements:

<