Property 'mapperLocations' was not specified.

Springboot启动控制台报Property 'mapperLocations' was not specified.或运行时报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误时,给予一下解决方案:

首先在pom文件里:


            
                src/main/java
                
                    **/*.xml
                
                true
            
            
                src/main/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

至此 不出意外是可以解决问题的!

你可能感兴趣的:(Property 'mapperLocations' was not specified.)