SSM
跟着视频做到这里,准备用tomcat7启动项目做测试,结果遇到了问题
tomcat启动失败,无法找到jdbc.properties配置资源
[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]
原因分析:
可能是springCongfig的配置问题:
解决方案:
经过和源码的比对配置中@PropertySources写的不同:
由于我没有在@PropertySource中写classpath: 而是直接写了路径名称,重新build后tomcat可以启动项目