I use Spring to configure my Java application and in my Spring configuration I get the data source via JNDI for Jetty as follows:
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/myDataSource" />
but this will not work with Tomcat. With Tomcat, I have to do this:
<jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/myDataSource" />
What is the best way to solve this problem? I am already using JNDI as a means of externalizing the configuration, so I cannot externalize my external configuration! At the same time, I absolutely do not want to have two separate Spring configuration files. HELP !!!
spring tomcat tomcat6 jetty jndi
Hdave
source share