解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"
来源:互联网 发布:擦除上网痕迹软件 编辑:程序博客网 时间:2024/06/13 05:56
<context:property-placeholder>
标签提供了一种优雅的外在化参数配置的方式,不过该标签在spring配置文件中只能存在一份!
导致这一问题的原因:使用了重复的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}"
ignore-unresolvable:是否忽略解析不到的属性,如果不忽略,找不到将抛出异常ignore-unresolvable:是否忽略解析不到的属性,如果不忽略,找不到将抛出异常
阅读全文
1 0
- 解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"
- 解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"
- $Value{}ntException: Could not resolve placeholder 'KEY' in string value "${
- Could not resolve placeholder 'driverClassName' in string value "${driverClassName}"
- Could not resolve placeholder 'CUST_INDUSTORY' in string value "${CUST_INDUSTORY}"
- Could not resolve placeholder 'driver' in string value "${driver}"
- Could not resolve placeholder 'driverClasss' in string value "${driverClasss}"
- 解决 Could not resolve placeholder 'some.var.name' in string value
- Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}
- Could not resolve placeholder 'master.jdbc.url' in string value "${master.jdbc.url}"
- Could not resolve placeholder 'spring.security.mapping.directory' in string value "${spring.security
- Could not resolve placeholder 'jdbc.username' in string value "${jdbc.username}"
- Could not resolve placeholder 'jdbc.url' in string value "${jdbc.url}"
- 报错Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}
- Could not resolve placeholder 'redis.pool.maxTotal' in string value "${redis.pool.maxTotal}"
- Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}错误
- 错误笔记之Could not resolve placeholder 'jdbc.driver' in string value "${jdbc.driver}"
- spring cloud config---Could not resolve placeholder 'foo' in string value "${foo}"
- windows server 2008 R2开启ftp服务
- 如何在Mac上新建Jenkins agent节点进行iOS打包(二)
- http://blog.sina.com.cn/s/blog_4fd2a65a0101gg2o.html
- HashMap的三种遍历方式
- Leetcode双指针16
- 解决 IllegalArgumentException: Could not resolve placeholder in string value "${XXXXXX}"
- 用openssl进行rsa的加密与解密(linux,C++版)
- Oralce awr报告分析
- viewpager动态更新数据重新setAdapter(FragmentPagerAdapter)不起作用
- TASKCTL4.1安装选项详解
- 面试太紧张?Xmind来帮忙
- 0-1背包和完全背包问题
- 根文件系统制作
- 一年800多万中国人涌向泰国 他们真是去旅游?