• IllegalStateException: Property 'configuration' and 'configLocation' can not specified with together


    原因:配置重复导致冲突

    举例:

    application.yml

    mybatis:
      mapper-locations: classpath:mapper/*Mapper.xml
      type-aliases-package: com.mmdz.entity
      # sql 打印
      configuration:
        log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
      config-location: classpath:mybatis/mybatis-config.xml

    在springboot的application.yml不能同时使用以下两个配置,换句话说,两者配置方式只能取其一.

    解决:

    application.yml

    mybatis:
      mapper-locations: classpath:mapper/*Mapper.xml
      type-aliases-package: com.mmdz.entity
      config-location: classpath:mybatis/mybatis-config.xml
    mybatis-config.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
            "http://mybatis.org/dtd/mybatis-3-config.dtd">
    <configuration>
        <settings>
            <setting name="cacheEnabled" value="false" /><!-- 暂时禁用缓存 -->
            <setting name="logImpl" value="STDOUT_LOGGING"/><!-- 打印sql-->
        </settings>
        <plugins>
            <plugin interceptor="com.mmdz.common.interceptor.PaginationInterceptor"></plugin>
        </plugins>
    </configuration>
  • 相关阅读:
    CentOS单用户模式下修改ROOT密码和grub加密
    CentOS配置SSH单向无密码访问
    物流追踪
    SpringBoot整合Redis及Redis
    小程序毫秒级倒计时(适用于拼团秒杀功能)
    foreach中的collection
    ArrayList和LinkedList的区别
    JavaScript 基础
    自用 goodsdetail
    JAVA常用处理数据
  • 原文地址:https://www.cnblogs.com/mmdz/p/14831400.html
Copyright © 2020-2023  润新知