spring boot集成mybatis 出现 nvalid bound statement (not found)

公司新搭建的项目 再idea中进行springboot集成mybatis时项目能正常启动,但在链接数据库时提示nvalid bound statement (not found)

或者是没在mapper接口中添加@Mapper注解,我一一排查后发现都不是。最后在一片博文里看到了解决方案

解决方案:

1.排查spring boot的主配置文件里面有没有配置加载mybatis的配置

mybatis.typeAliasesPackage=com.zpark.dao
mybatis.mapperLocations=classpath:mapper/*.xml

2.查看mybatis中的mapper.xml文件里面的  dao层类名和实体类名和配置文件的是否一致,dao层有没有添加@Mapper注解

猜你喜欢

转载自www.cnblogs.com/qinxu/p/12335787.html