NullPoint… 2022-09-05 23:45 采纳率: 100%
浏览 161
已结题

org.apache.ibatis.annotations不存在

org.apache.ibatis.annotations不存在的问题

在运行模块时报错

报错如下:

D:\Develop_Tools\JAVA\jdk1.8.0_144\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\Software\IntelliJ IDEA 2022.2\lib\idea_rt.jar=59671:D:\Software\IntelliJ IDEA 2022.2\bin" -Dfile.encoding=UTF-8 -classpath D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\charsets.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\deploy.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\access-bridge-64.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\cldrdata.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\dnsns.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\jaccess.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\jfxrt.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\localedata.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\nashorn.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\sunec.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\sunjce_provider.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\sunmscapi.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\sunpkcs11.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\ext\zipfs.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\javaws.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\jce.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\jfr.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\jfxswt.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\jsse.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\management-agent.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\plugin.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\resources.jar;D:\Develop_Tools\JAVA\jdk1.8.0_144\jre\lib\rt.jar;D:\JavaDev\SpringCloudPractice\user_service\target\classes;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-starter-jdbc\2.7.3\spring-boot-starter-jdbc-2.7.3.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-starter\2.1.7.RELEASE\spring-boot-starter-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot\2.1.7.RELEASE\spring-boot-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-autoconfigure\2.1.7.RELEASE\spring-boot-autoconfigure-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-jdbc\5.1.9.RELEASE\spring-jdbc-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-beans\5.1.9.RELEASE\spring-beans-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-tx\5.1.9.RELEASE\spring-tx-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.2.2\mybatis-spring-boot-starter-2.2.2.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.2.2\mybatis-spring-boot-autoconfigure-2.2.2.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\mybatis\mybatis\3.5.9\mybatis-3.5.9.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-starter-web\2.1.7.RELEASE\spring-boot-starter-web-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-starter-json\2.1.7.RELEASE\spring-boot-starter-json-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-starter-tomcat\2.1.7.RELEASE\spring-boot-starter-tomcat-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\apache\tomcat\embed\tomcat-embed-core\9.0.22\tomcat-embed-core-9.0.22.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\apache\tomcat\embed\tomcat-embed-el\9.0.22\tomcat-embed-el-9.0.22.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.22\tomcat-embed-websocket-9.0.22.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-web\5.1.9.RELEASE\spring-web-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-webmvc\5.1.9.RELEASE\spring-webmvc-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-aop\5.1.9.RELEASE\spring-aop-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-context\5.1.9.RELEASE\spring-context-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-expression\5.1.9.RELEASE\spring-expression-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-starter-logging\2.1.7.RELEASE\spring-boot-starter-logging-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-starter-test\2.1.7.RELEASE\spring-boot-starter-test-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-test\2.1.7.RELEASE\spring-boot-test-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\boot\spring-boot-test-autoconfigure\2.1.7.RELEASE\spring-boot-test-autoconfigure-2.1.7.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\net\minidev\json-smart\2.3\json-smart-2.3.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\junit\junit\4.12\junit-4.12.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\assertj\assertj-core\3.11.1\assertj-core-3.11.1.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\mockito\mockito-core\2.23.4\mockito-core-2.23.4.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\net\bytebuddy\byte-buddy\1.9.16\byte-buddy-1.9.16.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\net\bytebuddy\byte-buddy-agent\1.9.16\byte-buddy-agent-1.9.16.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\objenesis\objenesis\2.6\objenesis-2.6.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\skyscreamer\jsonassert\1.5.0\jsonassert-1.5.0.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\com\vaadin\external\google\android-json\0.0.20131108.vaadin1\android-json-0.0.20131108.vaadin1.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-core\5.1.9.RELEASE\spring-core-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-jcl\5.1.9.RELEASE\spring-jcl-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\springframework\spring-test\5.1.9.RELEASE\spring-test-5.1.9.RELEASE.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\xmlunit\xmlunit-core\2.6.3\xmlunit-core-2.6.3.jar;D:\Develop_Tools\apache-maven-3.8.6\mvn_resp\org\projectlombok\lombok\1.18.8\lombok-1.18.8.jar com.mikumikumi.UserApplication
错误: 找不到或无法加载主类 com.mikumikumi.UserApplication

手动再次运行UserApplication出了以下报错

D:\JavaDev\SpringCloudPractice\user_service\src\main\java\com\mikumikumi\Mapper\UserMapper.java:4:37
java: 程序包org.apache.ibatis.annotations不存在

相关代码/配置

UserApplication类

package com.mikumikumi;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.SpringApplication;
/**
 * @ClassName UserApplication
 * @Description TODO 启动项目
 * @Date 2022/9/4 23:26
 * @Author SakuraNya
 * @Version 1.0
 */
@SpringBootApplication
@EntityScan("com.mikumikumi.entity")
public class UserApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class,args);
    }
}

UserMapper类

package com.mikumikumi.Mapper;

import com.mikumikumi.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


/**
 * @ClassName UserMapper
 * @Description TODO Mapper接口
 * @Date 2022/9/4 23:25
 * @Author SakuraNya
 * @Version 1.0
 */
@Mapper
public interface UserMapper {
    @Select("select * from sa_user where id = #{id}")
    User selectById(int id);

}

模块Maven配置


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>SpringCloudPractice</artifactId>
        <groupId>com.mikumikumi</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>user_service</artifactId>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.46</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
            <version>2.7.3</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>2.2.2</version>
        </dependency>
    </dependencies>

</project>

尝试解决

参考:https://blog.csdn.net/HermitSun/article/details/88861353
结果:未解决,我使用的是自己的maven,版本是3.8.6

img

参考:https://blog.csdn.net/AdminGuan/article/details/103882007
结果:未解决,加上去依旧报错。

img

img

参考:清除idea缓存
结果:没有解决问题

项目源文件

https://www.aliyundrive.com/s/aQWs9NUf4DP

烦请各位帮忙解答,万分感谢!

  • 写回答

5条回答 默认 最新

  • nssnail 2022-09-06 02:14
    关注

    在在终端输入一次man idea:idea
    不行,明天再看看吧😂

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

问题事件

  • 系统已结题 9月14日
  • 已采纳回答 9月6日
  • 赞助了问题酬金20元 9月5日
  • 创建了问题 9月5日

悬赏问题

  • ¥15 请问1553 RT怎么测试,没有BC有方法吗
  • ¥100 业务编程如何选择学习方向和内容?
  • ¥15 wamp3.3.5安装完成后图标正常显示绿色,鼠标左右键点击图标均无反应。求解决方法。
  • ¥15 鼠标点击的这条记录了什么?
  • ¥15 在写pid调速的程序时,电机始终维持最大速度
  • ¥15 【有偿】调用DXGI截图初始化失败,提示0xf 887a0004
  • ¥15 请问如何查看手机root记录?
  • ¥15 商城小程序订单号重复
  • ¥15 学校优化算法sbo和蚁群算法怎么结合
  • ¥21 matlab怎么求时域信号的二阶导数