Backend/Errors

[스프링] java.io.FileNotFoundException - Could not open ServletContext resource 에러

마로그래머 2021. 8. 7. 19:02
반응형

[java.io.FileNotFoundException] Could not open ServletContext [/WEB-INF/action-servlet.xml]

[java.io.FileNotFoundException] Could not open ServletContext resource경고문이 나올 때 해결방법

증상

Spring SimpleUrlController 이용해서 jsp 요청하다가 증상이 나타남.

HTTP Status 500 - Internal Server Error 에러를 뿜으면서 에러가 났다.

원인

컨테이너에서 action-servlet.xml 을 찾지 못해서 에러가 났다.

해결

web.xml에서 경로를 지정해주면 된다.

<servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.springframework.web.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/action-servlet.xml</param-value>
    </init-param>
</servlet>
반응형