org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.atguigu.eduserv

出现这个错误主要是因为mapper中的xml为编译,target中是找不到编译文件的。

解决方法:

在pom.xml中加上:

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

然后在springboot配置文件中加上:(用自己xml所在路径)

#配置mapper xml文件的路径
mybatis-plus.mapper-locations=classpath:com/atguigu/eduservice/mapper/xml/*.xml

重启项目即可。target中就可以找到xml编译文件啦


版权声明:本文为weixin_45706529原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。