Could not resolve placeholder
来源:互联网 发布:2016年网络流行语串词 编辑:程序博客网 时间:2024/05/17 00:53
Could not resolve placeholder
翻译过来的意思就是“无法解析占位符”
我遇到了一个问题,便是如此
常出现在myeclipse中Spring的初始化的过程中,是加载property配置文件的错误信息
信息如下
org.springframework.beans.factory.BeanDefinitionStoreException:
和
Invalid bean definition with name ‘xxxx’ defined in class path resource [Spring/applicationContext.xml]:
和
Could not resolve placeholder ‘xxxx’ in string value “${xxxx}”
我遇到问题的详细错误信息 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [Spring/applicationContext.xml]: Could not resolve placeholder 'jdbc.driverClass ' in string value "${jdbc.driverClass }"
at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:209)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.processProperties(PropertySourcesPlaceholderConfigurer.java:174)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.postProcessBeanFactory(PropertySourcesPlaceholderConfigurer.java:151)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:669)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3800)
at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1377)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1350)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1586)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:280)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1164)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1388)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1392)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1360)
at java.lang.Thread.run(Thread.java:745)
通常可能的情况
- 文件路径错误
- 使用了多个
PropertyPlaceholderConfigurer
- 重复使用了
<context:property-placeholder>
解决方法
对于重复来说是添加ignore-unresolvable="true"
属性
如:
<context:property-placeholder location="yyy.properties" ignore-unresolvable="true"
/>
而我所遇到的问题的不是以上,而是拼写错误——空格
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.driverClass }"></property>
.......
在value里的表达式里多了一个空格
${jdbc.driverClass }
更改后
${jdbc.driverClass}
问题解决了
- Could not resolve placeholder
- Could not resolve placeholder
- "Could not resolve placeholder"解决方案
- Could not resolve placeholder 参考
- spring Could not resolve placeholder
- "Could not resolve placeholder"解决方案
- Could not resolve placeholder 解决方案
- spring报“Could not resolve placeholder”错误
- Could not resolve placeholder 'jdbc.driverClass'
- spring报“Could not resolve placeholder”错误
- spring报“Could not resolve placeholder”错误
- spring报“Could not resolve placeholder”错误
- Could not resolve placeholder jdbc.url
- Could not resolve placeholder"的解决方案
- Spring中报"Could not resolve placeholder"的解决方案
- Spring中报"Could not resolve placeholder"的解决方案
- Spring中报"Could not resolve placeholder"的解决方案
- spring报“Could not resolve placeholder”错误,解决方案
- 水题--整数解 HDU 2092
- BZOJ 3223 浅谈SPLAY伸展树算法区间翻转
- Python——有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?
- C语言(内存管理、文件处理)
- Java运算符
- Could not resolve placeholder
- main 主函数详解
- 关于getClass().getClassLoader() 为空的时候
- Mysql 视图
- dubbo控制台, jdk8以及linux的scp免密传输
- 语句(Statement)---循环语句
- Spring Batch 例子: 从数据库导出定长文件
- JSON 与XML的简单比较
- 微信小程序开发常用技巧(6)——列表上拉加载更多