• Could not resolve placeholder ‘jdbc.driver‘ in string value “${jdbc.driver}“


    转自:

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

    下文讲述今天编译代码时,出现以下异常的处理方法分享,如下所示
    这种异常一般都是配置文件编写错误导致的异常,我们只需修改配置文件,即可解决此异常

    十二月 22, 2022 23:06:08 下午 org.apache.catalina.core.StandardContext listenerStart
    严重: 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 [D:\Test\target\classes\spring\applicationContext.xml]: Could not resolve placeholder 'jdbc.driver' in string value "${jdbc.driver}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'jdbc.driver' in string value "${jdbc.driver}"
    	at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:211)
    	at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.processProperties(PropertySourcesPlaceholderConfigurer.java:177)
    	at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.postProcessBeanFactory(PropertySourcesPlaceholderConfigurer.java:152)
    	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284)
    	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:166)
    	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:677)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:519)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'jdbc.driver' in string value "${jdbc.driver}"
    	at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
    	at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
    	at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:204)
    	at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:178)
    	at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$2.resolveStringValue(PropertySourcesPlaceholderConfigurer.java:172)
    	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
    

    解决方法

    修改前:
    
    
    
    修改后:
    
    
    
    
    ignore-unresolvable默认的设置为false 
  • 相关阅读:
    chatgpt
    springboot整合actuator、admin对应用程序进行监控
    C语言输出以下图案
    【Pygame实战】打扑克牌嘛?赢了输了?这款打牌游戏,竟让我废寝忘食。
    [答疑]统计报表和被统计的数据是聚合还是依赖关系
    Vue2.0开发之——Vue基础用法-vue-cli(30)
    Web前端:2022年最新web开发技术
    vue 环境变量那些事
    【序列召回推荐】(task3)GNN召回之SR-GNN
    基于yolov5+streamlit目标检测演示系统设计
  • 原文地址:https://blog.csdn.net/qq_25073223/article/details/127627261