Spring Webアプリケーションを起動しようとすると、次のエラーメッセージが表示されます。
2012-04-12 13:53:20,491 ERROR [org.springframework.web.servlet.DispatcherServlet] -
Context initialization failed
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [timex-servlet.properties] cannot be opened because it does not exist
java.io.FileNotFoundException: class path resource [timex-servlet.properties] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:137)
at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:172)
eclipseを介してTomcat(バージョン6.x)を実行しています。次のディレクトリにtimex-servlet.propertiesを配置しようとしましたが、役に立ちませんでした。
WebContent\WEB-INF
WebContent\WEB-INF\classes
WebContent\
timex-servlet.xmlのtimex-servlet.propertiesへの参照は次のとおりです。
<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location"
value="timex-servlet.properties" />
</bean>
プロパティファイル参照の前にクラスパスを置くという同じメッセージを処理するSOスレッドがいくつかあります。そこで、次のことを試しましたが、これも機能しませんでした。
<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location"
value="classpath:timex-servlet.properties" />
</bean>