Use WebSphere bindings to define resource environment reference JNDI names

JBoss-specific deployment descriptors, jboss-web.xml and jboss.xml, might contain resource environment reference elements. These elements map resource environment references to a JNDI name. This rule detects the JBoss resource environment reference JNDI names. bindings file.

Example of jboss-web.xml constructs detected:

<jboss-web>
...
<resource-env-ref>
<resource-env-ref-name>jms/myQueue</resource-env-ref-name>
<jndi-name>jndi/myQueue</jndi-name>
</resource-env-ref>
...
</jboss-web>

The corresponding resource environment reference must be available in the corresponding web.xml file. For this example, the web.xml file must contain a resource-env-ref named jms/myQueue.

<web-app>
...
<resource-env-ref>
<resource-env-ref-name>jms/myQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
...
</web-app>

When the automated fix becomes available the JNDI name saved in the bindings file, and the reference is correlated to a <resource-env-ref> element in the web.xml file.

Similarly for jboss.xml EJB constructs, when <resource-env-ref> elements correspond to an <resource-env-ref> element in the ejb-jar.xml for a specific EJB, the JNDI name will be saved in WebSphere traditional and Liberty bindings.

<jboss>
<enterprise-beans>
</session>
<ejb-name>MyBean</ejb-name>
...
<resource-env-ref>
<resource-env-ref-name>jms/myQueue</resource-env-ref-name>
<jndi-name>jndi/myQueue</jndi-name>
</resource-env-ref
...
</session>
</enterprise-beans>
</jboss>