2016-04-11 65 views
1

我們正在從JDK 1.6遷移到1.7,並且我們使用的是Spring 2.5.1版本。 當啓動應用程序時,我得到以下錯誤。Spring 2.5.1是否兼容JDK 1.7

org.springframework.beans.factory.BeanCreationException:錯誤創建名稱爲豆 'tivoliTransferManager' 在ServletContext的資源定義[/WEB-INF/classes/spring-managers.xml]:BeanPostProcessor的bean的實例化之前失敗;嵌套異常是org.springframework.beans.factory.BeanCreationException:使用名稱'org.springframework.transaction.config.internalTransactionAdvisor'創建bean時出錯:無法創建類型爲[org.springframework.transaction.interceptor]的內部bean'(內部bean)' .TransactionInterceptor]同時設置bean屬性'transactionInterceptor';嵌套異常是org.springframework.beans.factory.BeanCreationException:創建名爲'(內部bean)'的bean時出錯:在設置bean屬性'transactionManager'時無法解析對bean'transactionManager'的引用;嵌套異常是org.springframework.beans.factory.BeanCreationException:在ServletContext資源[/WEB-INF/classes/spring.xml]中定義的名稱爲'transactionManager'的bean創建時出錯:設置bean屬性時無法解析對bean'sessionFactory'的引用'的sessionFactory';嵌套的異常是org.springframework.beans.factory.BeanCreationException:在ServletContext資源中定義名稱爲'sessionFactory'的bean時出錯[/WEB-INF/classes/spring.xml]:設置bean屬性時無法解析對bean'dataSource'的引用'數據源';嵌套異常是org.springframework.beans.factory.BeanCreationException:在ServletContext資源[/WEB-INF/classes/spring.xml]中定義的名稱爲'dataSource'的bean創建時出錯:bean的初始化失敗;嵌套異常是java.lang.IllegalArgumentException:在:: 0的錯誤找不到引用切入點addSingleUserToGroupPointCut at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory $ 1.run(AbstractAutowireCapableBeanFactory.java:379) at java.security。 AccessController.doPrivileged(本機方法) 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)

我們需要遷移的春天版本呢?

也請找spring.xml的內容

<?xml version="1.0" encoding="UTF-8"?> 

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd 
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> 

    <import resource="spring-managers.xml" /> 
    <import resource="spring-elementpermissions.xml" /> 
    <import resource="spring-scheduling.xml" /> 

    <context:annotation-config /> 
+1

請添加'spring.xml'的問題身上。 –

+2

[AOP:java.lang.IllegalArgumentException:在:: 0錯誤找不到引用切入點]的可能重複(http://stackoverflow.com/questions/10482563/aop-java-lang-illegalargumentexception-error-at- 0-cant-find-referenced-poi) –

+1

請查看spring.xm –

回答

1

豆初始化失敗的錯誤;嵌套的例外是java.lang.IllegalArgumentException異常:在:: 0找不到切入點addSingleUserToGroupPointCut在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory $ 1.run

引用看起來問題罐子aspectjweaver.jar錯誤。

請檢查jar文件和配置兼容aspectjweaver.jar版本

3

Spring 2.5的不與JDK 1.7至少explicitly.It始建和JDK 1.6兼容測試,但我認爲它應該工作的JDK 1.7 1.7禁止任何大的JDK破壞。除了這個錯誤似乎並不像JDK版本相關的問題。

我會建議將Spring升級到更高版本,因爲在以後的版本中有很多改進和新功能。