Use WebSphere bindings to define message-driven bean JNDI names

The message-driven-descriptor configures the destination for the message listener. A message destination reference is a logical name used to locate an enterprise bean in an EJB module that acts as a message destination. Message destination references exist only in J2EE 1.4 and later artifacts such as:

If multiple message destination references are associated with a single message destination link, then a single JNDI name for an enterprise bean that maps to the message destination link, and in turn to all of the linked message destination references, is collected during deployment. At run time, the message destination references are bound to the administered message destinations in the target operational environment. If a message destination reference and a message-driven bean are linked by the same message destination, both the reference and the bean must have the same destination JNDI name. When both have the same name, only the destination JNDI name for the message-driven bean is collected and applied to the corresponding message destination reference. If a deployer chooses to generate default bindings when installing the application, the installation wizard assigns JNDI names to the following incomplete message destination references:
If a message destination reference has a <message-destination-link>, then the JNDI name is set to ejs/message-destination-linkName . Otherwise, the JNDI name is set to eis/message-destination-refName .

This rule detects destination JNDI names for message-driven beans. An automated fix will copy the destination JNDI name from the weblogic-ejb-jar.xml file to the WebSphere(R) Application Server bindings file. The automated fix , however, will not set the ActivationSpec JNDI name or migrate the activation configuration properties in the ejb-jar.xml.

Manual solution for Liberty


Manual solutions for WebSphere traditional

An application developer can create binding definitions in ibm-xxx-bnd.xml files for EJB 3.0 and Web 2.5 modules and in ibm-xxx-bnd.xmi files for modules that existed before Java(R) Platform, Enterprise Edition (Java EE) 5. The application developer can create the files using a tool such as an IBM(R) Rational(R) developer tool or, for EJB 3.0 or Web 2.5 modules, using an XML editor or text editor. The developer then gives an enterprise application (.ear file) that is complete with bindings to an application assembler or deployer. When assembling the application, the assembler does not modify the bindings. Similarly, when installing the application onto a server supported by WebSphere Application Server, the deployer does not modify or override the bindings or generate default bindings unless changes to the bindings are necessary for successful deployment of the application.

To make the required changes in Rational Application Developer for EJB 2.1 beans, complete the following actions:
  1. Start the assembly tool, Rational Application Developer.
  2. Open the correct EJB Project.
  3. Double-click the deployment descriptor
  4. Click the correct message-driven bean.
  5. Scroll down to the WebSphere Bindings section.
  6. Select the JCA Adaptor check box, and enter ActivationSpec JNDI name.


To make the required changes in the administrative console for EJB 2.0 beans, complete the following actions: Rational Application Developer Version 7.0 does not support setting EJB 2.1 activation specifications for EJB 2.0 beans. You can set EJB 2.1 activation specifications for EJB 2.1 beans only.
  1. Set the activation specification for the MDB using the administrative console when you deploy the application to WebSphere Application Server.
  2. Export the EAR file for the application from the administrative console.
  3. Copy the deployment descriptor from the EAR file into the project so that it has the correct activation specification.

Define bindings during application assembly

An application assembler can define bindings in annotations or deployment descriptors of an application. Java EE 5 modules contain annotations in the source code. To declare an annotation, an application assembler precedes a keyword with the @ character. Bindings for pre-Java EE 5 modules are specified in the WebSphere Bindings section of a deployment descriptor editor. Modifying the deployment descriptors might change the binding definitions in the bindings files that are created when developing an application. After defining the bindings, the assembler gives the application to a deployer. When installing the application onto a server supported by WebSphere Application Server, the deployer does not modify or override the bindings or generate default bindings unless changes to the bindings are necessary to deploy the application.


Define bindings during application installation

An application deployer or server administrator can modify the bindings when installing the application onto a server supported by WebSphere Application Server using the administrative console. New binding definitions can be specified on the installation wizard pages.
Also, a deployer or administrator can select to generate default bindings during application installation. Choosing to generate default bindings during application installation instructs the product to complete bindings in the application with default values. Existing bindings are not changed.
Restriction: You cannot define or override bindings during application installation for application clients. You must define bindings for application client modules during assembly and store the bindings in the bindings file.


Define bindings during configuration of an application installation

After an application is installed onto a server supported by WebSphere Application Server, an application deployer or server administrator can modify the bindings by changing values in administrative console pages such as those accessed from the settings page for the enterprise application.