java.lang.IllegalArgumentException: Could not resolve placeholder 'orm.mybatis.basePackage

编程入门 行业动态 更新时间:2024-10-08 22:19:42

java.lang.IllegalArgumentException: Could not <a href=https://www.elefans.com/category/jswz/34/1770829.html style=resolve placeholder 'orm.mybatis.basePackage"/>

java.lang.IllegalArgumentException: Could not resolve placeholder 'orm.mybatis.basePackage

报错如下:Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder ‘orm.mybatis.basePackage’ in string value “${orm.mybatis.basePackage}”

说没有找到mybatis包 
明显这里是个配置,应该是spring-boot去加载mybatis的基础包的时候没有加载出来

OK,换个思路解决问题,可能是spring boot根本就没有找到配置文件。 
我们知道

在Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式,其中{profile}对应你的环境标识,比如:

application-dev.properties:开发环境
application-test.properties:测试环境
application-prod.properties:生产环境

至于哪个具体的配置文件会被加载,需要在application.properties文件中通过spring.profiles.active属性来设置,其值对应{profile}值。

也就是说你是不是没有设置环境导致的。

启动参数上面加入-Dspring.profiles.active=dev 解决问题

或者:IDEA上面profile那一栏加个dev解决问题

版权声明:本文为博主原创文章,转载请注明出处,谢谢。

更多推荐

java.lang.IllegalArgumentException: Could not resolve placeholder 'orm.myba

本文发布于:2024-02-28 06:43:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1768414.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:IllegalArgumentException   resolve   java   lang   mybatis

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!