In spring web-app we have a bean
<bean id="test" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/testRes"/>
</bean>
in glassfish4 config this source declared as jdbc/testRes
it's all work but if we write jndi name like this
<bean id="test" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/testRes"/>
</bean>
it stops working.
this web app have many declares jndi name like java:comp/env/jdbc/testRes and we need to maintain compatibility in tomcat7 and glassfish4.
how can we configure a mapping of this names ?
we have found a solution but it doesn't work
<resource-ref>
<res-ref-name>java:comp/env/jdbc/testRes</res-ref-name>
<jndi-name>jdbc/testRes</jndi-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Please help