Spring中报"Could not resolve placeholder"的错误

错误描述:除去properites文件路径错误、拼写错误外,出现”Could not resolve placeholder”很有可能是使用了多个PropertyPlaceholderConfigurer或者多个的原因。

严重: 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 ‘com.alibaba.dubbo.config.RegistryConfig’ defined in null: Could not resolve placeholder ‘dubbo.registry’ in value “[Math Processing Error] d u b b o . r e g i s t r y " ; n e s t e d e x c e p t i o n i s j a v a . l a n g . I l l e g a l A r g u m e n t E x c e p t i o n : C o u l d n o t r e s o l v e p l a c e h o l d e r ′ d u b b o . r e g i s t r y ′ i n v a l u e " {dubbo.registry}”
at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:223)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.processProperties(PropertySourcesPlaceholderConfigurer.java:180)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.postProcessBeanFactory(PropertySourcesPlaceholderConfigurer.java:152)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:283)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:163)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5157)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5680)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]和\[2\]中的错误信息显示,出现了"Could not resolve placeholder"的错误,这意味着在配置文件中找不到对应的占位符。具体来说,错误信息中提到了'spring.datasource.druid.initialSize'和'show.tips.text'这两个占位符无法解析。引用\[3\]中给出了一些解决方法。首先,确认配置文件中是否存在这些字段,并且字段名是否正确。其次,检查配置文件是否正确引用了相应的配置文件。在Spring Boot中,我们可以使用application.yml文件来指定使用哪个配置文件。例如,可以在application.yml中使用'spring.profiles.active'来指定使用名为'druid'的配置文件。如果以上步骤都正确无误,但仍然出现该错误,可能是由于其他原因导致的。可以进一步检查项目的依赖和版本是否正确,以及相关的配置是否正确。 #### 引用[.reference_title] - *1* *3* [springboot启动报错Could not resolve placeholder xxx](https://blog.csdn.net/a_helloword/article/details/118334203)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [【解决方法汇总】SpringBoot项目报错 Could not resolve placeholder ‘‘ in value “${}“](https://blog.csdn.net/yu1812531/article/details/123466616)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值