Когда я пытаюсь запустить App.java, я получаю следующую ошибку.
Error creating bean with name 'dbase': Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [src/main/resources/databaseconfig.properties] cannot be opened because it does not exist
Вот мой конфигурационный файл весны
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<import resource="SpringCollections.xml"/> <!-- Loading multiple Configuration files -->
<import resource="SpringBeans.xml"/>
<util:properties id="dbase" location="src/main/resources/databaseconfig.properties"/>
</beans>
Любая идея, что я делаю неправильно?
По умолчанию файлы в каталоге src/main/resources
помещаются в ваш путь к классам. Поэтому вы должны искать свой файл свойств в /databaseconfig.properties
.