Announcement Announcement Module
Collapse
No announcement yet.
FileNotFoundException for servlet context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FileNotFoundException for servlet context

    Hi all, can I get some help troubleshooting this exception please? I'm following along with the example at https://src.springframework.org/svn/...vc-basic/trunk, which works when I check it out, and have applied it somewhat simplified to my own project. My web.xml maps my footeware servlet to WEB-INF/footeware-servlet.xml which I can see but the application seemingly can't.

    Sorry for the long post but I don't know what else to do with it

    Code:
    HTTP Status 500 -
    
    type Exception report
    
    message
    
    description The server encountered an internal error () that prevented it from fulfilling this request.
    
    exception
    
    javax.servlet.ServletException: Servlet.init() for servlet footeware threw exception
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
        org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        java.lang.Thread.run(Thread.java:722)
    
    root cause
    
    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/footeware-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/footeware-servlet.xml]
        org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
        org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
        org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
        org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
        org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
        org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
        org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
        org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
        org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
        org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
        org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
        org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
        org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
        org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
        javax.servlet.GenericServlet.init(GenericServlet.java:160)
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
        org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        java.lang.Thread.run(Thread.java:722)
    
    root cause
    
    java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/footeware-servlet.xml]
        org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:140)
        org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
        org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
        org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
        org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
        org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
        org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
        org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
        org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
        org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
        org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
        org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
        org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
        org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
        org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
        javax.servlet.GenericServlet.init(GenericServlet.java:160)
        org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
        org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
        org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        java.lang.Thread.run(Thread.java:722)
    Any ideas on why it can't be found or how to debug this?

    Craig

  • #2
    Problem solved. I had copied his pom entries including maven-compiler-plugin set 1.5.:

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>${maven.compiler.plugin.version}</version>
    <configuration>
    <source>1.5</source>
    <target>1.5</target>
    <showWarnings>true</showWarnings>
    </configuration>
    </plugin>


    I set them to 1.7 and now it works.

    Craig

    Comment


    • #3
      Nope, that didn't fix it; the error is back. Seems to be connected to the Mongrel plugin I'm using to interface with my local Tomcat 7 server. Anyone know of a better way to run an eclipse dynamic web project on a server while in development?

      Craig

      Comment

      Working...
      X