如下所示,当我在XML文件中通过class属性配置其mapper文件时,出现下述错误
<mappers> <mapper class="mappers.userMapper"/> </mappers>
错误描述:
解决方法如下所示:在pom.xml文件中添加下述代码
<build> <resources> <resource> <!--此处配置到java是因为mapper.xml文件在java目录--> <directory>src/main/java</directory> <includes> <include>**/*</include> </includes> <filtering>false</filtering> </resource> </resources> </build>
重新运行后又出现了下述错误:
解决方法如下所示:
将该XML文件复制放置target目录下: