日期:2014-05-17  浏览次数:20671 次

tomcat数据源小问题
context.xml配置了数据源。。。正常。
服务器重启一次,数据源消失了。
肯定就报错了。。
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/configs/beans-jpa.xml]: Cannot resolve reference to bean 'adDataSource' while setting bean property 'dataSource';

忘了是改哪个了。。。

------解决方案--------------------
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

你的数据库配置里,driver class没配
------解决方案--------------------
是这个没有了?
Java code

<Resource 
        auth = "Container"
        name = "jdbc/adbDataSource"
        type = "javax.sql.DataSource" 
        driverClassName = "oracle.jdbc.driver.OracleDriver"
        url = "jdbc:oracle:thin:@10.xx.xx.xx:1521:xxx" 
        username = "ad"
        password = "adxxx"
        maxIdle = "5"
        maxWait = "5000"
        maxActive = "10"/>