springboot报错:NoClassDefFoundError: org/springframework/transaction/ReactiveTransactionManager

不打扰是莪最后的温柔 提交于 2020-03-03 15:17:17
  • springboot启动报错:java.lang.NoClassDefFoundError: org/springframework/transaction/ReactiveTransactionManager

不添加org.springframework.boot:spring-boot-starter-data-jpa:2.2.5.RELEASE,只有org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1, 则启动报错。

原因: org.springframework.boot:spring-boot-starter-data-jpa:2.2.5.RELEASE 依赖的spring-tx为5.2.4.RELEASE 其中有ReactiveTransactionManager类。 而org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1依赖org.springframework:spring-jdbc:5.1.10.RELEASE依赖spring-tx为5.1.10.RELEASE,其中没有ReactiveTransactionManager类。

解决: 增加org.springframework.boot:spring-boot-starter-jdbc:2.2.5.RELEASE,则依赖的org.springframework:spring-tx为5.2.4.RELEASE

 

 

gradle依赖配置:

dependencies {
        compile 'org.springframework.boot:spring-boot-starter-web:2.2.5.RELEASE'
        compile 'org.springframework.boot:spring-boot-starter-aop:2.2.5.RELEASE'
        compile 'org.springframework.boot:spring-boot-starter-undertow:2.2.5.RELEASE'
        compile 'org.springframework.boot:spring-boot-starter-jdbc:2.2.5.RELEASE'
        
        compile 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.1'
        compile 'com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13'
        compile 'com.google.guava:guava:28.2-jre'
        compile 'cn.hutool:hutool-all:5.1.5'
        //compile 'com.alibaba:fastjson:1.2.66'        
        
        compile 'org.mariadb.jdbc:mariadb-java-client:2.5.4'    
}

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!