org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition re

本文记录了一次在搭建SpringMVC过程中遇到的配置错误:在web.xml中未正确指定资源路径,导致无法加载ApplicationContext配置文件。作者通过仔细检查并添加正确的类路径前缀解决了该问题。

今天搭建SpringMvc的时候突然报:

org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [spring/ApplicationContext-*.xml]; nested exception is java.io.FileNotFoundException: ServletContext resource [/spring/] cannot be resolved to URL because it does not exist

经过自习检查路径配置文件名字什么都没有写错.最后发现是在web.xml中配置的时候少写了classpath:切记


25-07-08 10:28:22 WARN[main] support.ClassPathXmlApplicationContext.refresh(AbstractApplicationContext.java:546): Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'sso' defined in null: Could not resolve placeholder 'zkconnect' in string value "${zkconnect}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'zkconnect' in string value "${zkconnect}" 25-07-08 10:28:22 ERROR[main] container.Main.main(Main.java:86): [DUBBO] Invalid bean definition with name 'sso' defined in null: Could not resolve placeholder 'zkconnect' in string value "${zkconnect}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'zkconnect' in string value "${zkconnect}", dubbo version: 2.8.4, current host: 127.0.0.1 org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'sso' defined in null: Could not resolve placeholder 'zkconnect' in string value "${zkconnect}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'zkconnect' in string value "${zkconnect}" at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:211) at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:222) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86) 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:678) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) at com.alibaba.dubbo.container.spring.SpringContainer.start(SpringContainer.java:50) at com.alibaba.dubbo.container.Main.main(Main.java:80) at com.hisign.pics.service.main.ServiceProvider.main(ServiceProvider.java:22)
07-10
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'gcmNotificationMap' defined in null: Could not resolve placeholder 'Tapo.SelfCleanRobotHeatingModuleErrorEvent.type' in value "${Tapo.SelfCleanRobotHeatingModuleErrorEvent.type}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'Tapo.SelfCleanRobotHeatingModuleErrorEvent.type' in value "${Tapo.SelfCleanRobotHeatingModuleErrorEvent.type}" at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:230) at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:211) at com.tplink.cloud.common.config.utils.CommonPropertyPlaceholderConfigurer.processProperties(CommonPropertyPlaceholderConfigurer.java:46) at com.tplink.cloud.msgcenter.config.PushConfig.processProperties(PushConfig.java:171) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:291) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:167) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:707) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85) at com.tplink.cloud.msgcenter.Bootstrap.initSpringContent(Bootstrap.java:123) ... 2 more Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'Tapo.SelfCleanRobotHeatingModuleErrorEvent.type' in value "${Tapo.SelfCleanRobotHeatingModuleErrorEvent.type}" at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:230) at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:296) at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:217) at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitMap(BeanDefinitionVisitor.java:272) at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:211) at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:147) at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:85) at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:227)
09-16
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值