找不到properties
Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [src/main/resources/jdbc.properties] cannot be opened because it does not exist
properties和xml都放在源文件(main/java目录下)的resources目录下了
能读到xml
信息: Loading XML bean definitions from class path resource [spring-annotation.xml]
一月 07, 2017 3:29:50 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring-resource.xml]
一月 07, 2017 3:29:50 下午 org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
信息: Loading properties file from class path resource [src/main/resources/jdbc.properties]
但是后面就报错了。。。找不到这个文件
test类的classpath:spring-annotation.xml我是放在test目录下的resources目录下
上面两个在源文件下
测试类读取的xml在测试类自己的resources下
两个是分开的,我以为都是classpath。。。结果是不行的