mybatis+atomikos出现invalid bound statement (not found)
程序员文章站
2022-05-23 12:26:17
...
我在用atomikos做分布式事务的时候出现invalid bound statement (not found)
,网上找了好多办法都没有解决,最后我还是通过谷歌查找到解决办法。
解决办法如下:
在配置SqlSessionFactory的方法中添加你项目编译后Class包mapper的路径:如下代码中的:sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:com/byr/myselfdemo/mapper/mysql_mapper/mapper_xml/*.xml"));
public SqlSessionFactory systemSqlSessionFactory() throws Exception {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().
getResources("classpath*:com/byr/myselfdemo/mapper/mysql_mapper/mapper_xml/*.xml"));
sqlSessionFactoryBean.setDataSource(systemDataSource());
return sqlSessionFactoryBean.getObject();
}
上一篇: MFC导入导出EXCEL文件
下一篇: Moto折叠屏手机外形全曝光:就是这样
推荐阅读
-
spring boot Invalid bound statement (not found)
-
使用junit进行单元测试时报错Invalid bound statement (not found)
-
SpringBoot整合mybatis访问时报错Invalid bound statement (not found)
-
引入mybatis-plus报 Invalid bound statement错误问题的解决方法
-
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
-
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found
-
Mybatis之Invalid bound statement
-
Mybatis之Invalid bound statement
-
Invalid bound statement (not found)问题解决方案
-
@org.apache.ibatis.annotations.Mapper 中的 Mapper 异常 Invalid bound statement (not found)