您的位置:首页 > 运维架构 > Apache

mybatis maven打包出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误

2017-06-26 00:00 1511 查看
使用maven,mybatis开发项目的时候,在eclipse中调试一切正常,当使用maven打出的包上传到Linux服务器上运行之后,会出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)。

检查maven配置,配置也是正确的。pom.xml也添加过如下配置

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

解压包之后,发现mapper.xml都在里面,还是会报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)。错误;

经过各种尝试,最后修改mapper.xml

由原来的得

<mappers>
<package name="com.server.canceluser.mapper" />
</mappers>

修改为

<mappers>
<mapper resource="com/server/canceluser/mapper/canceluserMapper.xml" />
<mapper resource="com/server/canceluser/mapper/queryInfoMapper.xml" />
<mapper resource="com/server/canceluser/mapper/snapshotMapper.xml" />
</mappers>

在出包测试,问题修复掉了!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐