当前位置 博文首页 > 、唐城:解决:java.lang.IllegalStateException: Property ‘con
本例环境: 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.