Spring&MyBatis pom配置

在使用最新版spring-boot-dependencies时遇到Doris连接异常,降级至2.1.4.RELEASE问题解决。mybatis-spring-boot-starter引入导致与spring版本不兼容,引发AbstractMethodError,改为直接引入mybatis和mybatis-spring解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用最新版本的<artifactId>spring-boot-dependencies</artifactId>,doris的连接异常,将该parent的版本降至2.1.4.RELEASE,doris连接可以正常。

使用mybatis-spring-boot-starter,一开始没有发现问题,后来出现报错,java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()L,是mybatis的版本跟spring的版本不兼容,去掉该依赖,使用mybatis包、mybatis-spring包。

...
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>2.1.4.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
...
    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis</artifactId>
        <version>3.2.3</version>
        </dependency>
    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis-spring</artifactId>
        <version>1.2.2</version>
    </dependency>
...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值