在整合Spring、SpringMvc、Mybatis时意外出现了这个错误,发现是SpringConfig配置中的注解@PropertySource引用资源书写出了问题,正确的书写应该是@PropertySource("classpath : jdbc.properties") 分号后面的是连接数据库的配置文件。
解决 java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.properties]
最新推荐文章于 2023-09-22 11:54:07 发布
在整合Spring、SpringMvc和Mybatis的过程中,出现了一个配置错误,原因是@PropertySource注解引用资源的路径不正确。问题已定位到应为@PropertySource(classpath:jdbc.properties),该配置文件用于设定数据库连接参数。
摘要由CSDN通过智能技术生成