Check Spring jndi-lookup element configuration

This rule flags the Spring element with the class jndi-lookup in Spring configuration files when the following conditions are met.

These elements are flagged so you can ensure that the appropriate entries also exist in the module deployment descriptor, the web.xml , WebSphere traditional and Liberty bindings files.

In this example the jndi-lookup is flagged because the jndi-name value is a variable

<jee:jndi-lookup id="myDataSource"
jndi-name="${myDS}"
vcache="true"
resource-ref="true"
lookup-on-startup="false"
proxy-interface="javax.sql.DataSource"/>

In this example the jndi-lookup is flagged because the proxy-interface value is not equal to javax.sql.DataSource .

<jee:jndi-lookup id="myDataSource"
jndi-name="jdbc/springdb"
vcache="true"
resource-ref="true"
lookup-on-startup="false"
proxy-interface="com.mycompany.SomeResource"/>

The recommended action is to examine the items and make the necessary changes to deployment descriptors. Consider making modifications so that this issue is flagged by the Related rule.

For additional information, see: