Cannot create JDBC driver of class "" for connect URL "null" 解决方案
Cannot create JDBC driver of class "" for connect URL "null" 解决方案 方案(1)
解决:在%TOMCAT_HOME%\conf\Catalina\localhost下找到你的web应用对应的.xml文件,如test.xml,并在此文件的下添入代码:
<ResourceLink name="jdbc/mysql" global="jdbc/mysql" type="javax.sql.DataSourcer"/>
重启tomcat。
你的是服务器的全局JNDI资源,而用InitialContext去找server的resource当然找不到了,要想找到server的resource就得在web application中的context环境里加入一个指向该全局resource的ResourceLink。
global -->The name of the linked global resource in the global JNDI context.
name -->The name of the resource link to be created, relative to the java:comp/env context.?
type -->The fully qualified Java class name expected by the web application when it performs a lookup for this resource link.