Java Spring2.5.1与JDK1.7兼容吗

Java Spring2.5.1与JDK1.7兼容吗,java,spring,spring-2.5,Java,Spring,Spring 2.5,我们正在从JDK1.6迁移到1.7,并使用Spring2.5.1版本。 启动应用程序时,我得到以下错误 <?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.springfram

我们正在从JDK1.6迁移到1.7,并使用Spring2.5.1版本。 启动应用程序时,我得到以下错误

<?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 />
org.springframework.beans.factory.BeanCreationException:创建名为“tivoliTransferManager”的bean时出错,该名称在ServletContext资源[/WEB-INF/classes/spring managers.xml]:bean实例化失败前的BeanPostProcessor;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.transaction.config.internalTransactionAdvisor”的bean时出错:设置bean属性“TransactionInterceptor”时无法创建[org.springframework.transaction.interceptor.TransactionInternalBean]类型的内部bean(内部bean);嵌套异常为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属性“sessionFactory”时无法解析对bean“sessionFactory”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:使用ServletContext资源[/WEB-INF/classes/spring.xml]中定义的名称“sessionFactory”创建bean时出错:设置bean属性“dataSource”时无法解析对bean“dataSource”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“dataSource”的bean时出错,该名称在ServletContext资源[/WEB-INF/classes/spring.xml]中定义:初始化bean失败;嵌套异常为java.lang.IllegalArgumentException:错误位于::0无法找到引用的切入点addSingleUserToGroupPointCut 位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:379) 位于java.security.AccessController.doPrivileged(本机方法) 位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)

<?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版本吗

<?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.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不兼容。它最初是在JDK 1.6上构建和测试的,但是我认为它应该与JDK 1.7 1.7兼容,除非JDK出现任何重大故障。此外,这个错误似乎根本不是与JDK版本相关的问题

<?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升级到更高版本,因为在更高版本中引入了很多改进和新功能

Spring2.5至少在明确意义上与JDK1.7不兼容。它最初是在JDK1.6上构建和测试的,但我认为它应该与JDK1.71.7兼容,除非JDK1.7出现任何重大故障。此外,这个错误似乎根本不是与JDK版本相关的问题

<?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升级到更高版本,因为在更高版本中引入了很多改进和新功能

错误

<?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 />
bean初始化失败;嵌套异常为java.lang.IllegalArgumentException:错误位于::0在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run中找不到引用的切入点addSingleUserToGroupPointCut

<?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 />
看起来jar
aspectjweaver.jar有问题

<?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 />
请检查jar文件并配置兼容的aspectjweaver.jar版本

错误

<?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 />
bean初始化失败;嵌套异常为java.lang.IllegalArgumentException:错误位于::0在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run中找不到引用的切入点addSingleUserToGroupPointCut

<?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 />
看起来jar
aspectjweaver.jar有问题

<?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 />

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

请将您的
spring.xml
添加到问题正文中。可能重复的请查找spring.xm的内容请验证aspectjweaver.jar并检查version@KannanThangadurai是的,建议的解决方案有效,我已升级aspect jar和问题现在已解决。请将您的
spring.xml
添加到问题正文。可能的重复项请查找spring.xm的内容请验证aspectjweaver.jar并检查version@KannanThangadurai是的,我已经升级了aspect jar,现在问题已经解决了。
<?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 />