Exception1:Cannot create JDBC driver of class "" for connect
解决:
1、<context>元素必须放在<host></host>之间.
2、自Tomcat5.5以后,<context>元素的<Resoucepram>元素取消,原参数元素都以Resouce的属性出现.
<Context path="" docBase="ROOT" debug="5" reloadable="true" crossContext="true">
<Resource name="jdbc/mysqltest" scope="Shareable" type="javax.sql.DataSource"
username="root" password="admin123" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/test" maxWait="3000" maxIdle="100" maxActive="10"/>
</Context>
Exception2:unable to get connection :no suitable driver
解决:
从eclipse中启动tomcat,发现启动时找不到org.apache.commons.dbcp.BasicDataSourceFactory,于是把Resouce元素中的factory="org.apache.commons.dbcp.BasicDataSourceFactory"删去,于是错误解决。