1、spring配置声明式事务时出现异常:Caused by: java.lang.ClassNotFoundException: org.springframework.core.annotation.AnnotatedElementUtils

原因:此类在spring4.0中才有,项目中可能有显示或隐式的引用了spring-tx4.0。而项目中配置的spring版本是4.0以下,因此会找不到此类

本例中引用了spring-data-redis:jar:1.4.1.RELEASE,而这个包又引用了spring-tx:jar:4.0.7.RELEASE。类似可用mvn dependency:tree命令排查错误。

解决办法:显式的引用spring-orm包即可,如:

 

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

2、

相关文章:

  • 2021-12-28
  • 2022-02-28
  • 2021-07-28
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-03
  • 2021-08-26
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
相关资源
相似解决方案