Invalid bound statement (not found): error solution

Error message:

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

Because: maven loading mechanism

By default, maven will only load and compile java-type files in the ser-main-java directory, and other types of files will not be loaded

 

Solution:

1. Put the xml file under the resources directory

2. Load by configuration

1. In pom.xml

<!--        maven记载机制1、在pom.xml添加-->
<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>

 

2. Add project configuration file

mybatis-plus: 
  mapper-locations: classpath:com/atguigu/auth/mapper/xml/*.xml # load xml file

Guess you like

Origin blog.csdn.net/Relievedz/article/details/130196636