[ERROR] Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.itheima.config.SpringConfig]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.properties]
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.properties]
在SpringConfig里修该这个
原来:
@PropertySource("jdbc.properties")
解决办法:
@PropertySource("classpath:jdbc.properties")
本文介绍了在Spring框架中配置文件加载失败的问题及解决方案。问题表现为无法打开资源文件,通过调整配置方式从类路径加载文件得以解决。
4501

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



