Check Spring JndiObjectFactoryBeans configuration

This rule flags Spring beans in the Spring configuration file which have the class org.springframework.jndi.JndiObjectFactoryBean . These beans are flagged to allow you to ensure that the appropriate entries also exist in the module deployment descriptor, the web.xml or the ejb-jar.xml , and the WebSphere traditional or Liberty bindings files.

The beans are flagged under the following conditions:

This example bean in a Spring configuration file would be flagged because the jndiName is a variable.

<bean id="myRes1" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="${someValue}"/>
<property name="proxyInterface" value="javax.sql.DataSource"/>
</bean>

This example bean in a Spring configuration file would be flagged because the proxyInterface value is not javax.sql.DataSource .

<bean id="myRes2" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="someValue"/>
<property name="proxyInterface" value="com.mycompany.SomeResource"/>
</bean>

The recommended action is to examine the beans 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: