1. 程式人生 > >org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

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

XML found EDA 寫法 ali role bin ring pack

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.dao.RoleDao.getRole

在Spring整合Mybatis中爆出這個錯。

在mybatis配置文件中原來寫法為:

<mappers>
    <package name="com.mapping" />
</mappers>

將其改成

<mappers>
    <mapper resource="com\mapping\roleMapper.xml"></mapper>
    <mapper resource="com\mapping\userMapper.xml"></mapper> 
</mappers>

就可以運行了,按照道理來說兩種方式應該都是可以運行的,莫非Spring只支持resource這一種配法?

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