If your project has a context.xml that explicitly names a datasource factory class like this:
<resource auth="Container" driverclassname="com.mysql.jdbc.Driver" factory="org.apache.commons.dbcp.BasicDataSourceFactory" name="jdbc/myDatabase" type="javax.sql.DataSource"/>
The "factory" attribute causes the problem on newer Tomcat's because they use their own factory class (org.apache.tomcat.dbcp.BasicDataSourceFactory) to deliver the datasource.
One solution that worked for me is:
- remove the "factory" attribute from your context.xml
element.
- copy your mysql driver Jar into Tomcat's common/lib folder
- delete Tomcat's copy of your context.xml from Tomcat's conf\Catalina\localhost folder. It is recreated upon Tomcat start up and gets the same name as your app's .war file.