报错信息:
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.properties]
这里查看配置的属性文件如下:
<context:property-placeholder location=“jdbc.properties” />
网上查了后发现很多人是路径问题,我看了下我的没错。又仔细一看才发现,没有加classpath。
修改后
<context:property-placeholder location=“classpath:jdbc.properties” />
解决。