Invalid bound statement (not found): com.atguigu.auth.mapper.SysMenuMapper.finMenuListByUserId

 出现蓝色部分的报错,一般有如下几种可能:1.Mapper.xml中映射mapper层写错     2.select标签中id值写错。

如果以上两种都没有错,可能是你将mapper.xml文件放在了src/java包中。但是maven加载机制,只会编译src/main/java中的java类型文件,其他类型不会进行加载。所以xml文件中的内容找不到。

解决:1.把xml文件放在resources中

        2.通过配置方式进行加载:(1)在pom.xml  (2)项目配置文件添加

1、在pom.xml添加
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.yml</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes> <include>**/*.yml</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>
    
2、application-dev.yml添加
mybatis-plus:
  mapper-locations: classpath:com/atguigu/auth/mapper/xml/*.xml

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值