关于 Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException 错误

web 项目在运行时报错时下所示:

 Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io 

.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)

解决方法:
错误原因为找不到 applicationContext.xml 文件,解决方法为在web.xml文件中修改


		contextConfigLocation
		classpath:applicationContext.xml
	


		contextConfigLocation
		classpath*:applicationContext.xml
	

即修改 classpath:applicationContext.xml 为 classpath:applicationContext.xml*

欢迎关注我的公众号:

编程技术与生活(ID:hw_cchang)

关于 Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException 错误_第1张图片

你可能感兴趣的:(Java,Web)