问答详情
源自:3-5 Hello Spring MVC

mvn jetty:run 后一直报 Could not open ServletContext resource [/WEB-INF/configs/spring/mvc-dispatcher-servlet.xml]

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/configs/spring/mvc-dispatcher-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletCo

提问者:化了个冰 2018-01-27 18:29

个回答

  • 慕无忌6806251
    2018-09-11 14:19:26

    这个是你ecpilse 工作空间有中文导致的,不要将你的工程路径设置在有中文的文件夹下,会导致加载不到WEB-INF路径。改成classpath*:这种形式可以访问到xml文件,但是在返回jsp页面时又会包404错误。

  • qq_懵懂的岁月_0
    2018-06-07 10:27:29

    路径改成classpath*:/.xml 。对了你解决了没? 我这里有404错误能帮我看看嘛?我发提问了

  • _昭阳_
    2018-03-29 17:10:55

    工程目录千万不要有中文!!

  • 化了个冰
    2018-01-27 18:31:59

    Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/configs/spring/mvc-dispatcher-servlet.xml]
        at org.springframework.web.context.support.ServletContextResource.getInputStream (ServletContextResource.java:141)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:330)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:304)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:181)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:217)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:188)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions (XmlWebApplicationContext.java:125)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions (XmlWebApplicationContext.java:94)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory (AbstractRefreshableApplicationContext.java:129)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory (AbstractApplicationContext.java:537)
        at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:452)
        at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext (FrameworkServlet.java:663)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext (FrameworkServlet.java:629)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext (FrameworkServlet.java:677)
        at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext (FrameworkServlet.java:548)
        at org.springframework.web.servlet.FrameworkServlet.initServletBean (FrameworkServlet.java:489)
        at org.springframework.web.servlet.HttpServletBean.init (HttpServletBean.java:136)