运行报错信息如下

Error starting ApplicationContext. To display the conditions report rerun your application withdebugenabled.
[threathunting:172.20.1.102:28085] 2022-11-04 15:02:23.912 ERROR 20660 [-] [main] o.s.b.d.LoggingFailureAnalysisReporter   

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder$AnnotationWrapper.<init&gt;(MybatisMapperAnnotationBuilder.java:677)

The following method did not exist:

    org.apache.ibatis.annotations.Select.databaseId()Ljava/lang/String;

The method‘s class, org.apache.ibatis.annotations.Select, is available from the following locations:

    jar:file:/D:/repository/org/mybatis/mybatis/3.5.3/mybatis-3.5.3.jar!/org/apache/ibatis/annotations/Select.class

The class hierarchy was loaded from the following locations:

    org.apache.ibatis.annotations.Select: file:/D:/repository/org/mybatis/mybatis/3.5.3/mybatis-3.5.3.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.apache.ibatis.annotations.Select

Disconnected from the target VM, address: ‘127.0.0.1:59677’, transport: ‘socket

Process finished with exit code 1

 问题分析,发现引用的是 mybatis 下的 select

 在我的 maven pom.xml没有找到这个

使出必杀技,在 idea terminal 窗口执行

mvn dependency:tree > a.txt

项目目录生成工程的所有的maven依赖

 在 pagehelper 分页插件引入mybatis jar

接下来问题就很好解决了,在项目找到pagehelper 这个依赖,包 mybatis 依赖排除

        <!--pagehelper-->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.13</version>
            <exclusions>
                <exclusion>
                    <artifactId>mybatis</artifactId>
                    <groupId>org.mybatis</groupId>
                </exclusion>
            </exclusions>
        </dependency>

 操作上述操作,从新启动项目启动成功

原文地址:https://blog.csdn.net/wangguoqing_it/article/details/127689261

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_38368.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注