SpringBoot和mybatis采用junit测试时找不到mapper.xml
怎么办正常启动项目通过浏览器测试没有问题,通过junit测试报Invalidboundstatement(notfound),看日志是没扫描到mapper.xml配置文件...
怎么办
正常启动项目通过浏览器测试没有问题,通过junit测试报Invalid bound statement (not found),看日志是没扫描到mapper.xml配置文件,我猜想是springboot的application.properties也没读取到
Property 'mapperLocations' was not specified or no matching resources found 展开
正常启动项目通过浏览器测试没有问题,通过junit测试报Invalid bound statement (not found),看日志是没扫描到mapper.xml配置文件,我猜想是springboot的application.properties也没读取到
Property 'mapperLocations' was not specified or no matching resources found 展开
1个回答
展开全部
mybatis 的springboot 集成项目已经发布了
maven
12345<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.0.0</version></dependency>
properties 配置
123456mybatis.config= # mybatis config filemybatis.mapperLocations= # mappers filemybatis.typeAliasesPackage= # domain object's package mybatis.typeHandlersPackage= # handler's packagemybatis.check-config-location= # check the mybatis configuration existsmybatis.executorType= # mode of execution. Default is SIMPLE
maven
12345<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.0.0</version></dependency>
properties 配置
123456mybatis.config= # mybatis config filemybatis.mapperLocations= # mappers filemybatis.typeAliasesPackage= # domain object's package mybatis.typeHandlersPackage= # handler's packagemybatis.check-config-location= # check the mybatis configuration existsmybatis.executorType= # mode of execution. Default is SIMPLE
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询