- 浏览: 50555 次
- 性别:
文章分类
最新评论
用spring 配置加载properties文件的时候,报Could not resolve placeholder 错误。
很有可能是使用了多个PropertyPlaceholderConfigurer或者多个<context:property-placeholder>的原因或者是多个PropertyPlaceholderConfigurer与<context:property-placeholder>混合使用。
解决方案:
在Spring3中可以用如下方式解决,找到所有<context:property-placeholder>
增加ignore-unresolvable="true"属性,注意必须都要加上
在Spring 2.5中,<context:property-placeholder>没有ignore-unresolvable属性,此时可以改用PropertyPlaceholderConfigurer。其实<context:property-placeholder location="xxx.properties" ignore-unresolvable="true" />与下面的配置是等价的
这次报错因为配了 <property name="ignoreUnresolvablePlaceholders" value="true" /> 而没有配置<context:property-placeholder location="xxx.properties" ignore-unresolvable="true" />
很有可能是使用了多个PropertyPlaceholderConfigurer或者多个<context:property-placeholder>的原因或者是多个PropertyPlaceholderConfigurer与<context:property-placeholder>混合使用。
解决方案:
在Spring3中可以用如下方式解决,找到所有<context:property-placeholder>
增加ignore-unresolvable="true"属性,注意必须都要加上
<context:property-placeholder location="xxx.properties" ignore-unresolvable="true" />
在Spring 2.5中,<context:property-placeholder>没有ignore-unresolvable属性,此时可以改用PropertyPlaceholderConfigurer。其实<context:property-placeholder location="xxx.properties" ignore-unresolvable="true" />与下面的配置是等价的
<bean id="XX" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="xxx.properties" /> <property name="ignoreUnresolvablePlaceholders" value="true" /> </bean>
这次报错因为配了 <property name="ignoreUnresolvablePlaceholders" value="true" /> 而没有配置<context:property-placeholder location="xxx.properties" ignore-unresolvable="true" />
发表评论
-
LVS DR keepalived 负载均衡服务器搭建
2018-05-28 10:18 0请参考https://www.cnblogs.com/li ... -
Communications link failure 异常处理几种方式
2018-05-17 11:26 112641.网上普遍存在的一种方法是改timeout即: 修改/e ... -
spring boot使用 cache和redis,@Cacheable失效解决
2018-01-05 21:25 5395先说一下如何配置spring boot+spring cac ... -
spring security 4结合spring boot,springMVC,maven
2017-11-27 18:28 0做这个做了一周多,遇到很多问题,遇到各种蛋疼的问题和自己挖 ... -
linux的“Connection refused”和 “No route to host”
2017-11-09 18:09 1930使用telnet查看端口信息的时候出现问题: 1. ... -
有用网址
2017-07-13 15:24 392好用java库 http://www.cnblogs.c ... -
ThreadLocal理解,原理
2017-07-07 16:11 560ThreadLocal是解决线程安全问题一个很好的思路 ... -
slf4j log4j配置 log4j过滤
2017-06-06 10:34 1037slf4j log4j配置 1.需要的jar包: ... -
linux 安装Tesseract-OCR java运行
2017-03-16 14:28 1134安装Tesseract-OCR准备工作:编译环境: gcc ... -
$.ajax请求request.getInputStream()得不到数据问题
2017-03-06 17:34 943请求中添加参数contentT ... -
springloaded热加载linux实现
2017-03-02 17:47 7241.下载springloaded-1.2.6.RELEAS ... -
HttpClient Connection reset问题
2017-02-09 09:29 1092请求头中的: postMethod.setRequestH ... -
date类型的string转成date类型
2016-12-14 15:04 610String s = "Tue Jul 16 12 ... -
httpclient3.1发送https 的post请求,带参
2016-09-27 19:39 1570package com.dahantc.fcchannel. ... -
synchronized 与 Lock线程安全
2016-06-15 20:35 734原文出处:http://www.cnblo ... -
hibernate orm配置一对多时,多方加一字段记录顺序
2016-04-01 20:07 931代码: 一方: import java.util.Li ... -
开发时,网页IE能打开,chrome、firefox无法打开问题
2016-03-07 16:40 1661原因:部分端口被这些浏览器限制了FIREFOX测试自己网 ... -
hibernate事务和jdbc事务冲突问题
2016-01-06 14:42 5347Pre-bound JDBC Connection found ... -
网卡受限制或无连接的解决办法
2014-03-03 12:49 777电脑杀毒后出现网卡受限制或无连接的状况。尝试过换网卡、网线都无 ...
相关推荐
按官方配置好了 developer.... Could not resolve com.huawei.agconnect 解决方法:把相应的插件用本地化安装 agconnect-crash-symbol-lib-1.6.1.300.jar agconnect-apms-plugin-1.6.1.300.jar agcp-1.6.1.300.jar。
myeclipse创建maven工程报错 Could not resolve
Could not resolve all dependencies for configuration ‘:classpath’. Could not resolve com.android.tools.build:gradle:2.1.2. ………. 等6个error 上网百度csdn,结果试下各种方法,依旧没用。 搞了一天,...
hive 开发UDF 使用maven工程 引发jar包缺失 hive 开发UDF 使用maven工程 引发jar包缺失
$_SERVER,$_HTTP,__FILE__
[INFO] ———————————————————————— [INFO] Reactor Summary for demo 0.0.1-SNAPSHOT: [INFO] [INFO] demo ……………………………………….. FAILURE [18:18 min] [INFO] admin-service ...
主要介绍了解决Unable to access 'https://gitee.com/自己的项目/': Could not resolve host: gitee.com问题,需要的朋友可以参考下
Error:Could not resolve all files for configuration ‘:app:debugCompileClasspath’. > Could not resolve com.android.support:appcompat-v7:26.0.0-beta1. Required by: project :app > Could not ...
新建maven项目时报Could not resolve archetype org.apache.maven.archetypes
Microsoft OLE DB Provider for ODBC Drivers 错误'80040e4d'[Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified. 使用PL-SQL Developer能连接上Oracle,但是ASP+ODBC连不上...
Eclipse Maven 创建Web 项目报错 Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap 之前找了很久才找到了,传上来更大家共享下,希望对大家有帮助,欢迎下载或者永久保存。
Could not resolve all files for configuration ':jcore-react-native:lintClassPath'. > Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15) > Could not get resource '
`org.hibernate.QueryException: could not resolve property: isStudent of: com.zluo.hibernate.po.User [from com.zluo.hibernate.po.User u where u.isStudent = ?]` 当时就在想怎么会出现这个错误呢,
安卓调取usb摄像头的工具类,包含了之前版本删除掉的类,解决:libusbcamera@debug/compileClasspath': Could not resolve com.serenegiant:common:1.5.20.报错问题,需要配合repository文件夹使用
build时出现错误Could not resolve nl.eveoh:gradle-aspectj:1.6。将此文件放入此目录下即可.m2\repository\nl\eveoh\gradle-aspectj\1.6
网上下载的开源SSL服务器扫描代码。 依赖与openssl库。 超级好用啊,精华之作。
asm-analysis-5.0.3.jar;asm-analysis-5.0.3.jar;asm-analysis-5.0.3.jar
Could not resolve dependencies for project ****:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1: Could not transfer ...