Wen accessing JNDI data source in applications the name has to be provided. But there is a difference between how they are provided in Tomcat vs Weblogic.
When I specify the name as "jdbc/source1
" in the container it is fine for Weblogic, but in tomcat I have to search for "java:comp/env/jdbc/source1
".
If I got an application that I sometimes deploy in a tomcat and sometimes in a Weblogic changing the name to look for is very annoying.
What is the right approach to overcome this?
Is there a way to configure Tomcat to look automatically in java:comp/env/ or provide the JNDIs not there but like Weblogic?
Or is there a well known code to automatically prepend the "java:comp/env/" if deployed in tomcat.