zoukankan      html  css  js  c++  java
  • 解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"

    如题:

    导致这一问题的原因:使用了重复的property-placeholder

    如一个配置文件中使用了

    <context:property-placeholder location="classpath:aa.properties" />

    而另一处使用了

    <bean id="propertyConfigurer">
              <!--class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">-->
            <property name="locations">-->
                <list>
                    <value>classpath:bb.properties</value>
                </list>
            </property>
        </bean>

    解决:

    主要从以下几个地方去解决:

    1. 去掉一处的propertyConfigurer配置,替换成context:property-placeholder

    2. 两处都添加ignore-unresolvable="true"

    配置文件1:

    <context:property-placeholder location="classpath:aa.properties" ignore-unresolvable="true" />

    配置文件2:

    <context:property-placeholder location="classpath:bb.properties" ignore-unresolvable="true" />
  • 相关阅读:
    字符串转换整数
    list、tuple、dict加*星号
    字符串
    整数反转
    字符串分割函数
    核密度图(直方图的拟合曲线)
    不同缺失值的删除方法
    Z字形变换
    最长回文字串
    寻找两个有序数组的中位数
  • 原文地址:https://www.cnblogs.com/davidgu/p/6413576.html
Copyright © 2011-2022 走看看