Recently I needed to reconfigure DataSource in Tomcat 6 though JNDI. Previously it was configured in Spring application context, but there was need to use DataSource also in BIRT template where Spring configuration was of little use, so the only option was to use JNDI.
Project uses Maven to build itself and appropriate database driver (for MySQL) was included as dependency, so it was in a classpath. After configuring JNDI in Tomcat I've got an error. After some debug I found out that it couldn't find database driver - though correct jar was in WEB-INF/lib. The trick is that Tomcat's JNDI picks only jars which are in classpath of Tomcat itself - so jar should be placed in $TOMCAT_HOME/lib.
There is also an option to use simple-jndi which can run inside web-application and use jars from WEB-INF/lib, but it needs to set some system properties so that simple-jndi would be used instead of Tomcat's JNDI implementation. Does anybody know some other way to use JDBC driver with JNDI without placing it into Tomcat's lib folder?