springboot整合mybatis错误 Invalid bound statement (not found): com.yuan.mapper.UserMapper.getUserList

出现的原因是 

src文件下的mapper有mapper接口和映射文件,而target下的mapper文件却没有映射文件

springboot整合mybatis错误  Invalid bound statement (not found): com.yuan.mapper.UserMapper.getUserList      springboot整合mybatis错误  Invalid bound statement (not found): com.yuan.mapper.UserMapper.getUserList

 

===========================解决方案==================================

 1.把映射文件 放到resources 目录下 结构目录一模一样

 2.在pom.xml中导入以下代码

<build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

 

springboot整合mybatis错误 Invalid bound statement (not found): com.yuan.mapper.UserMapper.getUserList

上一篇:【转帖】华为手机中国销量暴涨:中国手机产业多米诺骨牌被推翻


下一篇:最新---java多线程下载文件