Spring Frameworkを使用しているアプリケーションがあります。そして突然、サーバーの起動時に例外が発生し始めました。例外は次のとおりです。
ContextLoader E org.springframework.web.context.ContextLoader initWebApplicationContext
Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
java.io.FileNotFoundException: Could not open ServletContext resource
[/WEB-INF/applicationContext.xml]
しかし、私は確かにこのファイルを src/main/webapp/WEB-INF/ フォルダーに持っています。IBM WebSphereを使用していますが、サーバーの起動時にこの例外が発生します。アプリケーションを再デプロイするだけの場合 ( IntelliJ IDEAで作業しています) - 例外はキャッチされません。
この例外が突然発生し始めたことを付け加えておく価値があります。構成ファイルを変更しませんでした。
この問題を解決するにはどうすればよいですか?
これが私のweb.xml
ファイルです:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>