복붙노트

[SPRING] Spring 트랜잭션 관리자 (주석 스타일) 런타임 오류

SPRING

Spring 트랜잭션 관리자 (주석 스타일) 런타임 오류

그래서 글래스 피시 애플리케이션 서버에서 내 전쟁을 일으킬 때 예외적 인 상황이되고 있습니다. 내 mysql 데이터베이스와 함께 Spring의 트랜잭션 관리자를 사용하고있다. 보고 된 오류 (전체 스택 추적)는 다음과 같습니다.

java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.getAnnotation(Ljava/lang/reflect/AnnotatedElement;Ljava/lang/Class;)Ljava/lang/annotation/Annotation;

내 applicationContext.xml 파일은 다음과 같습니다.

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:sws="http://www.springframework.org/schema/web-services"
   xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:oxm="http://www.springframework.org/schema/oxm"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
   http://www.springframework.org/schema/tx
     http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
   http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd">

    <context:property-placeholder location="classpath:testjdbc.properties"/>

    <!-- enable the configuration of transactional behavior based on annotations -->
    <tx:annotation-driven transaction-manager="txManager"/>

      <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${jdbc.driverClassName}" />
        <property name="url" value="${jdbc.url}" />
        <property name="username" value="${jdbc.username}" />
        <property name="passwprd" value="${jdbc.password}" />
      </bean>

      <bean name="licenseGenService" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
        <property name="service" ref="LicensingDaoImpl"/>
        <property name="serviceInterface" value="mypackage.LicensingDao"/>
      </bean>

      <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name ="dataSource" ref="dataSource" />
      </bean>

      <bean id="licenseDAO" class = "myPackage.LicenseDao">
        <constructor-arg ref="dataSource" />
      </bean>

      <bean id="licenseGenerator" class ="myPackage.LicenseGeneratorImpl">
        <constructor-arg ref = "licenseDAO" />
      </bean>

</beans>

나는 그것이 애플 리케이션 컨텍스트에서조차도 울부 짖고있는 클래스가 없기 때문에이 오류가 꽤 어리 석다는 것을 알았다. 나는 봄 3.1을 사용하고있다. 어떤 제안이나 도움을 주셔서 감사합니다.

해결법

  1. ==============================

    1.클래스 패스를보고 거기에 모든 Spring 의존성의 버전이 하나만 있는지 확인하십시오.

    클래스 패스를보고 거기에 모든 Spring 의존성의 버전이 하나만 있는지 확인하십시오.

  2. ==============================

    2.분명히 응용 프로그램이 이전 버전의 spring-core * .jar를 사용하고 있습니다. 모든 Spring JAR 파일이 3.1.x 버전이고 중복 파일이 없는지 확인하십시오.

    분명히 응용 프로그램이 이전 버전의 spring-core * .jar를 사용하고 있습니다. 모든 Spring JAR 파일이 3.1.x 버전이고 중복 파일이 없는지 확인하십시오.

    spring-core * .jar에는 3.1에서 소개 한 AnnotationUtils.getAnnotation () 메소드가 포함되어 있습니다.

  3. from https://stackoverflow.com/questions/9164001/spring-transaction-manager-annotation-style-runtime-error by cc-by-sa and MIT license