Springboot启动控制台报Property 'mapperLocations' was not specified.或运行时报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误时,给予一下解决方案:
首先在pom文件里:
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**.*</include>
</includes>
</resource>
</resources>
其次在application文件里:
mybatis:
mapper-locations: classpath:xx/xx/xx/xx/mapper/*.xml
# mapper-locations: classpath:xx/xx/xx/xx/mapper/*/*.xml (这里适用于分包情况下又有子包使用对应路径方式)
type-aliases-package: xx.xx.xx.xx.pojo
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
至此 不出意外是可以解决问题的!
网友评论