Why can't my regular application context load my properties file? Why can't my regular application context load my properties file? spring spring

Why can't my regular application context load my properties file?


This comes down to where different application contexts look for their resources.

A unit test context looks at the classpath, but a webapp context looks inside the webapp. So when your webapp looks for localdevelopment_Company.properties, it's looking for a file at the root of the webapp.

If your file is actually on the classpath, then you need to override the webapp context's default search location:

<value>classpath:localdevelopment_Company.properties</value>