本例环境: springboot + IntelliJ IDEA
报错信息:
解决:
在springboot的application.yml不能同时使用以下两个配置,换句话说,两者配置方式只能取其一.
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
configuration:
map-underscore-to-camel-case: true
正确方式一:
mybatis:
# 指定全局配置文件位置
config-location: classpath:mybatis/mybatis-config.xml
# 指定sql映射文件位置
mapper-locations: classpath:mybatis/mapper/*.xml
正确方式二:
# 指定sql映射文件位置
mybatis:
mapper-locations: classpath:mybatis/mapper/*.xml
configuration:
map-underscore-to-camel-case: true
以上,TKS.
解决:java.lang.IllegalStateException: Property 'configuration' and 'configLocation' can not specified
最新推荐文章于 2024-11-13 00:54:52 发布