Spring 2.5.1 是否与 JDK 1.7 兼容

Is Spring 2.5.1 compatible with JDK 1.7

我们正在从 JDK 1.6 迁移到 1.7,我们正在使用 spring 2.5.1 版本。 启动应用程序时出现以下错误。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tivoliTransferManager' defined in ServletContext resource [/WEB-INF/classes/spring-managers.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.transaction.interceptor.TransactionInterceptor] while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/classes/spring.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/spring.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/classes/spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut addSingleUserToGroupPointCut at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.run(AbstractAutowireCapableBeanFactory.java:379) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)

我们是否也需要迁移 spring 版本?

另请查找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 />

Spring 2.5 至少与 JDK 1.7 不兼容 explicitly.It 最初是在 JDK 1.6 上构建和测试的 但是我认为它应该与 JDK 1.7 1.7 除非有任何大的 JDK 破损。此外,该错误似乎根本不是 JDK 版本相关问题。

我建议将 Spring 升级到更高版本,因为在更高版本中引入了许多改进和新功能。

错误

Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut addSingleUserToGroupPointCut at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.run

jar aspectjweaver.jar 看起来有问题。

请检查jar文件并配置兼容的aspectjweaver.jar版本