2013-10-24 73 views
0

我有以下問題:JDBC驅動程序屬性設置失敗

Caused by: 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 [org.postgresql.Driver] 
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:101) 
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1420) 
... 52 more 

至於多金屬氧酸鹽有依賴關係:

<dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>4.1.9.Final</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-orm</artifactId> 
     <version>3.2.4.RELEASE</version> 
    </dependency> 

    <dependency> 
     <groupId>postgresql</groupId> 
     <artifactId>postgresql</artifactId> 
     <version>9.0-801.jdbc4</version> 
    </dependency> 

更重要的是

postgresql-9.0-801.jdbc4.jar 

無論是在classpath中出現和lib文件夾的war包...

回答

0

請指定您用於依賴關係的特定版本,以便您可以更輕鬆地深入查看問題。此外,請檢查JDK兼容性。

<dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>???</version> 
    </dependency> 

<dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-orm</artifactId> 
     <version>???</version> 
    </dependency> 

    <dependency> 
     <groupId>postgresql</groupId> 
     <artifactId>postgresql</artifactId> 
     <version>???</version> 
    </dependency> 
+0

請參閱我更新的安裝程序。 – user2902211