Could not resolve placeholder 'jdbc.username' in string value "${jdbc.username}"

1、错误描述

严重: 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 file [E:\Eclipse\workspace\AMP\WebContent\WEB-INF\classes\spring\applicationContext.xml]: Could not resolve placeholder ‘jdbc.username‘ in string value "${jdbc.username}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘jdbc.username‘ in string value "${jdbc.username}"
	at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:211)
	at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:223)
	at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:162)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder ‘jdbc.username‘ in string value "${jdbc.username}"
	at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
	at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
	at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:259)
	at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:282)
	at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:204)
	at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:141)
	at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:82)
	at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:208)
	... 18 more

十月 19, 2015 10:05:44 上午 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart

2、错误原因

数据库配置文件中有个属性jdbc.username,但是修改的过程中将其注释掉了

3、解决办法

将jdbc.username解注,重启服务器Tomcat

版权声明:本文为博主原创文章,未经博主允许不得转载。

Could not resolve placeholder 'jdbc.username' in string value "${jdbc.username}"

时间: 2024-11-08 22:25:38

Could not resolve placeholder 'jdbc.username' in string value "${jdbc.username}"的相关文章

Could not resolve placeholder 'jdbc username' in string valu

1.错误描述 严重: 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'

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

spring同时集成redis和mongodb时遇到多个资源文件加载的问题 这两天平台中集成redis和mongodb遇到一个问题 单独集成redis和单独集成mongodb时都可以正常启动程序,但是当两个同时集成进去时就会报以下问题 Could not resolve placeholder 'mongo.port' in string value "${mongo.port} 百思不得解后,经多方搜集查证,终于找到问题原因. 在spring的xml配置文件中当有多个*.properties文

Could not resolve placeholder

使用spring的<context:property-placeholder location="/WEB-INF/redis.properties"/>读取properties配置文件报错 Could not resolve placeholder 项目结构 配置 启动报错 顺着这个错误向上找发现.properties文件没有全部加载, log4j.properties在web.xml中配置加载, jdbc.properties和redis.properties文件都配置

Could not resolve placeholder &#39;master.jdbc.url&#39; in string value &quot;${master.jdbc.url}&quot;

org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'masterDataSource' defined in file [C:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\xinghe-mycenter-web\WEB-INF\classes\spri

Could not resolve placeholder &#39;driver&#39; in string value &quot;${driver}

可能是因为配置文件jdbc.properties 和xml文件不一致导致的,比如 jdbc.properties里面写的是 但是xml文件里面写 导致了取值错误,两边一致即可. Could not resolve placeholder 'driver' in string value "${driver} 原文地址:https://www.cnblogs.com/ljsn/p/8656493.html

Could not resolve placeholder&#39;XXX&#39; in string value &quot;XXXX&quot;

练习SSM项目的demo中遇到一个问题,我在applicationContext.xml中使用了<context:property-placeholder location="classpath:jdbc.properties"/>,我还想再引入另外一个resource.properties,resource.properties中的key我在controller层引用,用的是@Value(value="${type}")注解,总是出现如题的问题,从网上

Could not resolve placeholder &#39;spring.security.mapping.directory&#39; in string value &quot;${spring.security

1.错误描述 2015-09-20 22:30:25 [main] WARN org.springframework.context.support.GenericApplicationContext - Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanDefinitionStoreException: In

websphere启动报/WEB-INF/applicationContext-orm- hibernate.xml]: Could not resolve placeholder &#39;hibernate.hbm2ddl.auto&#39; in string value &quot;${hibernate.hbm2ddl.auto}&quot;

启动websphere错误: [17-11-20 16:19:52:834 CST] 0000008e webapp I com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet 消息 - [market_war#market.war]:.Initializing Spring root WebApplicati onContext [17-11-20 16:19:53:361 CST] 0000008e SystemOut O 2

Could not resolve placeholder &#39;IMAGE_SERVER_URL&#39; in string value &quot;${IMAGE_SERVER_URL}&quot;

出现错误的主要原因是:property-placeholder重复使用 解决:加上ignore-unresolvable="true"即可 如下: Could not resolve placeholder 'IMAGE_SERVER_URL' in string value "${IMAGE_SERVER_URL}" 原文地址:https://www.cnblogs.com/rgever/p/10355515.html