簡體   English   中英

加載applicationContext時出現FileNotFound異常

[英]FileNotFound exception while loading applicationContext

我有一個使用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>

我剛剛檢查了我的IBM WebSphere Application Server上的應用程序列表,並發現另一個應用程序給出了此異常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM