如题:

导致这一问题的原因:使用了重复的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" />

解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"的更多相关文章

  1. Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'jdbc.username' in string value "${jdbc.username}"

    1.启动dubbo的引用dubbo服务时候报下面这个错误,这是由于去找dubbo的发布服务未找到报的错误,所以先启动dubbo的发布服务即可. [INFO] Scanning for projects ...

  2. IDEA报错: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"

    运行审核流模块: 在ActivitiServiceApplication模块日志报错: Error starting ApplicationContext. To display the auto-c ...

  3. springcloud中config启动时候报错Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'config.info' in value "${config.info}"

    -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jm ...

  4. springboot启动异常:java.lang.IllegalArgumentException: Could not resolve placeholder 'xxx.xxx.xxx' in value "${xxx.xxx.xxx}"

    场景: 本地启动正常,部署到服务器上启动时启动tomcat失败,显示上面的问题. 原因: 本地打包的时候没有修改指定的配置文件名称(本地只有一份配置文件). 在打包到服务器上时指定的配置文件命名会去查 ...

  5. 5.29 @Value{name}无效时怎么办Could not resolve placeholder ‘name22’ in value “${name22}” 错误解决

    springboot Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder ‘name22’ in ...

  6. Could not resolve placeholder

    使用spring的<context:property-placeholder location="/WEB-INF/redis.properties"/>读取prope ...

  7. Spring @Value注入值失败,错误信息提示:Could not resolve placeholder

    问题根源: @Value("${wx.app.config.appid}") public Object appid; 异常信息: Caused by: java.lang.Ill ...

  8. spring错误<context:property-placeholder>:Could not resolve placeholder XXX in string value XXX

    spring同时集成redis和mongodb时遇到多个资源文件加载的问题 这两天平台中集成redis和mongodb遇到一个问题 单独集成redis和单独集成mongodb时都可以正常启动程序,但是 ...

  9. spring错误:<context:property-placeholder>:Could not resolve placeholder XXX in string value XXX

    spring同时集成redis和mongodb时遇到多个资源文件加载的问题 这两天平台中集成redis和mongodb遇到一个问题 单独集成redis和单独集成mongodb时都可以正常启动程序,但是 ...

随机推荐

  1. chrome浏览器调试报错:Failed to load resource: the server responsed width a status of 404 (Not Found)…http://127.0.0.1:5099/favicon.ico

    chrome浏览器在调试的时候默认会查找根目录下的favicon.ico文件,如果不存在就会报错. 解决办法:F12,点击<top frame>左侧漏斗形状的filter,勾选上" ...

  2. iOS 字符串 中包含 % 百分号的方法

    百分号的转换,NSString中需要格式化的字符串中百分号使用%%表示,而char*中百分号也是使用%%表示. 例如:NSLog(@"%%%@%%",@"hello&qu ...

  3. excel 单元格内容太多,替换有问题

    excel 单元格内容太多,替换有问题

  4. sendto 和 recvfrom 函数

    sendto recvfrom

  5. EntityFramework:状态变化与方法的关系(朋友的学习笔记)

    一.约定OnModelCreating 有一些限制需要注意,例如: 1.表名不支持使用标签进行标注 2.最小长度在 OnModelCreating 中不支持 3.正则表达式在 OnModelCreat ...

  6. java如何直接返回excel到客户端

    既然是web项目首先你得拿到响应才能向外部写出,你得拿到响应对象response,1.添加如下两行代码response.setContentType("application/vnd..ms ...

  7. [Web 前端] React高级教程(es6)——(2)对于Refs最新变动的理解

    cp : https://blog.csdn.net/liwusen/article/details/53384561 1.什么是ReactJS中的refs 在React中组件并不是真实的 DOM 节 ...

  8. 输入两个很大的正数(用C字符串表示),输出他们的乘积,将设不考虑非法输入。

    #include<iostream> #include<cassert> void multiply(const char *a,const char *b) { assert ...

  9. C#如何通过反射调用带有ref或者out的参数的方法

    写这篇博客,原起今天CyljXu问我一个问题:如何通过反射调用带有ref或者out的参数的方法?想着可能其他人也会遇到这个问题,权且记录下来,以备后行者搜索到. 这个在MSDN上有解释,参考 Meth ...

  10. Go语言之进阶篇连接mysql

    一.Go连接mysql 1.mysql驱动 地址:https://github.com/Go-SQL-Driver/MySQL 说明: sql.Open()函数用来打开一个注册过的数据库驱动,Go-M ...