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

  • 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'    
}

 

来自:' . https://blog.csdn.net/tower888/article/details/104628368 . '


更多相关内容:请点击查看