Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey

HTTP Status 500 - Request processing failed; nested exception is java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey

异常:
Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey

原因:没有编译mapper的xml

解决方法:

在dao工程的pom文件中添加如下内容:

<!-- 如果不添加此节点mybatis的mapper.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>**/*.properties</include>
				<include>**/*.xml</include>
			</includes>
			<filtering>false</filtering>
		</resource> -->
	</resources>
</NOild>

猜你喜欢

转载自blog.csdn.net/qq_39234840/article/details/84133832