解决:java.lang.IllegalStateException: Property ‘configuration‘ and ‘configLocation‘ can not specified

简介: 解决:java.lang.IllegalStateException: Property ‘configuration‘ and ‘configLocation‘ can not specified

本例环境: springboot + IntelliJ IDEA

71e4a54228bba5027af52a4cc4024d4.png

报错信息:

解决:

  在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.

目录
相关文章
Unable to interpret the implicit parameter configuration with dataType: , dataTypeClass: class java.
Unable to interpret the implicit parameter configuration with dataType: , dataTypeClass: class java.
1238 0
|
XML Java 数据格式
|
NoSQL 测试技术 Scala
java.lang.RuntimeException: Can‘t start redis server. Check logs for details.
java.lang.RuntimeException: Can‘t start redis server. Check logs for details.
351 1
|
Java
Error:(15, 13) java: No property named “id” exists in source parameter(s). Did you mean “null”?
Error:(15, 13) java: No property named “id” exists in source parameter(s). Did you mean “null”?
680 1
|
Java 开发工具 计算机视觉
Caused by: java.lang.UnsatisfiedLinkError: Can‘t load AMD 64-bit .dll on a IA 32-bit platform【已解决】
Caused by: java.lang.UnsatisfiedLinkError: Can‘t load AMD 64-bit .dll on a IA 32-bit platform【已解决】
454 0
|
Java
【Java异常】com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not use this method fo
【Java异常】com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not use this method fo
1345 0
|
Oracle 安全 Java
[Java] `JDK17` 模式变量 `Pattern variable` Variable ‘request‘ can be replaced with pattern variable
[Java] `JDK17` 模式变量 `Pattern variable` Variable ‘request‘ can be replaced with pattern variable
336 0
|
JSON Java 数据格式
【Java报错】记录一次 sun.misc.Unsafe.park(Native Method) Conflicting setter definitions for property 导致的内存泄露
【Java报错】记录一次 sun.misc.Unsafe.park(Native Method) Conflicting setter definitions for property 导致的内存泄露
724 0
Can not set final java.lang.Class field org.apache.ibatis.binding.MapperProxy.mapperInterface to com
Can not set final java.lang.Class field org.apache.ibatis.binding.MapperProxy.mapperInterface to com
407 0