The JBoss deployment descriptors, jboss-web.xml
and jboss.xml,
might contain resource references that map the resource reference to a
resource manager or resource URL, as demonstrated in the example.
For the references to work correctly on WebSphere traditional or Liberty,
they must be moved to the WebSphere Application Server
bindings file. Alternatively,
Liberty references can be moved to the server.xml.
As defined in the JBoss DTD, the <resource-ref> tag can have three
different tags following the <res-ref-name> tag:
- resource-name
- jndi-name
- res-url
<!ELEMENT resource-ref (res-ref-name , (resource-name | jndi-name | res-url))>
This rule flags the resource-name and res-url cases.
<jboss-web>
<reference-ref>
<res-ref-name>ejb/myBean</res-ref-name>
<resource-name>resMgrMail</resource-name>
</reference-ref>
...
<resource-managers>
<resource-manager>
<res-name>resMgrMail</res-name>
<res-jndi-name>java:Mail</res-jndi-name>
</resource-manager>
</resource-managers>
<jboss>
<enterprise-beans>
<session>
<ejb-name>myBean</ejb-name>
<resource-ref>
<res-ref-name>test/Mail</res-ref-name>
<resource-name>resMgrMail</resource-name>
</resource-ref>
</session>
</enterprise-beans>
...
<resource-managers>
<resource-manager>
<res-name>resMgrMail</res-name>
<res-jndi-name>java:Mail</res-jndi-name>
</resource-manager>
</resource-managers>
The application developer can create the bindings manually using the
IBM(R) Rational(R) Application Developer tool.
To make the required changes in Rational Application Developer:
- Start the developer tool.
- Open the correct EJB or Web project.
- Double-click the deployment descriptor to open the deployment descriptor editor.
- On the References tab, click Add.
- From the dialog, select Resource References, then Next.
- Enter the resource reference, name, type and authentication type.
- Click Finish.
- Scroll down to the WebSphere Bindings section of the page.
- Enter the JNDI name for that resource reference.
If the WebSphere Bindings section is not visible on the deployment descriptor editor,
enable them using the Project Facets in the project properties. For
EJB projects, select the WebSphere EJB (extended) facet. For Web projects,
select WebSphere Web (Co-existence) facet.