异常是java.lang.IllegalStateException:无法加载JDBC驱动程序类

时间:2016-04-14 04:05:17

标签: java spring hibernate spring-mvc jdbc

我有使用oracle数据库的代码spring + hibernate。我已经设置了配置,但仍然出现如下错误:

 cannot Deploy Spring3HibernateApp
deploy is failing=Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]. Please see server.log for more details.

我已经创建了这样的database.properties:

database.driver=oracle.jdbc.driver.OracleDriver
database.url=jdbc:oracle:thin:@xxx:1521:xxx
database.user=xxxx
database.password=welcome1
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update

当我在ADF中尝试时,程序正在运行。

我该如何解决?

1 个答案:

答案 0 :(得分:2)

你需要从这个链接下载oracl JDBC Driver:

http://www.oracle.com/technetwork/apps-tech/jdbc101040-094982.html

接受许可,然后选择

ojdbc14.jar 

下载后,复制jar文件,然后将其传递到classpath / lib文件夹