views:

14

answers:

2

Hi, i am trying to use a custom .properties file i created to host some properties about a SQL database but the issue is that my spring app cant find it.

i get the following error

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.properties]

i have tried to put this file in the root of my project and also inside the root of the WEB-INF folder and still no joy.

my properties configurer bean looks like this:

<bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>jdbc.properties</value>
        </list>
    </property>
</bean>
A: 

What happens when you try classpath*:jdbc.propertie or classpath:jdbc.properties?

AHungerArtist
ok i will try that. where does the properties folder suppose to go?
jonney
+1  A: 

The error indicates that the jdbc.properties file should go in the root of the WAR, i.e. alongside the WEB-INF directory, not inside it.

skaffman
Thanks i will try that
jonney