The FNFE is pretty clear about where Spring is expecting to find your context file based on your configuration. Note that this file is optional for Spring MVC, otherwise for that config you need to have applicationContext.xml under WEB-INF and therefore in src/main/webapp/WEB-INF by default.
This problem is one of Spring config so it's probably best discussed on one of their forums. Brett On 4/29/09, Don Hosek <[email protected]> wrote: > It's being loaded using > > <context-param> > <param-name>contextConfigLocation></param-name> > <param-value>applicationContext.xml</param-value> > </context-param> > > in the web.xml file. My servlet.xml is under WEB-INF and that doesn't > seem to be the problem. The relevant bit of logs appears to be > > INFO: Loading XML bean definitions from ServletContext resource [/WEB- > INF/applicationContext.xml] > Apr 27, 2009 8:38:53 PM org.springframework.web.context.ContextLoader > initWebApplicationContext > SEVERE: 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] > at > org > .springframework > .beans > .factory > .xml > .XmlBeanDefinitionReader > .loadBeanDefinitions(XmlBeanDefinitionReader.java:349) > > > On 28 Apr 2009, at 14.50, Brett Randall wrote: > >> Which mechanism are you using in Spring to load the context? What >> error/stack-trace do you get? >> >> Note that if you are using Spring MVC and a DispatcherServlet, it >> expects by >> default to find the context file under WEB-INF directly, so your >> source path >> would be src/main/webapp/WEB-INF/myservlet-servlet.xml . >> >> Brett >> >> On Wed, Apr 29, 2009 at 7:17 AM, Don Hosek <[email protected]> >> wrote: >> >>> Hmm, I've got a spring application context XML file stored in >>> src/main/resources But it's not being found in the classpath when I >>> do mvn >>> jetty:run. Checking the target/classes directory when I run it, I >>> see the >>> file there, but it's not being found by the jetty container. What >>> should I >>> be doing? >>> >>> -dh >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Sent from my mobile device --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
