org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:applicationContext-service.xml]
Offending resource: class path resource [applicationContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext-service.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext-service.xml] cannot be opened because it does not exist
原因:使用spring的import导入xml时找不到xml配置文件
解决方法:将import标签中的passpath改为passpath*。
passpath:只会在你class路径中找文件
passpath*:不仅会在class路径,还会在jar文件中的class路径找文件。
本文探讨了Spring Boot中遇到的BeanDefinitionParsingException,焦点在于如何修复从classpath:applicationContext-service.xml导入XML配置失败的问题。解决方法是将import路径改为classpath*以扩大查找范围。
4596

被折叠的 条评论
为什么被折叠?



