Could not open ServletContext resource [/WEB-INF/spring3Mvc-servlet.xml]

I got this error message today in a new SpringMVC project.

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/spring3Mvc-servlet.xml]
 at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:118)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
 ... 32 more

To fix this you have to tell the DispatcherServlet where your spring configuration is. This here solved my problem.

<servlet>
    <servlet-name>Spring MVC Dispatcher Servlet</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>

Archetype: SpringMVC + Spring 3.0.5.RELEASE + JPA 1.0

This maven2 archetype contains a little sample application with the Spring 3.0.5 Framework, Spring Mvc and JPA 1.0. It is deployed on the PLOIN Repository-Server on

http://www.ploin-m2.de/nexus/content/groups/public/

you can create a project from the archetype with the following command:

mvn archetype:generate -DarchetypeGroupId=org.ploin.archetype -DarchetypeArtifactId=tempSpringMvcJpa -DarchetypeVersion=1.1 -DarchetypeRepository=http://www.ploin-m2.de/nexus/content/groups/public/ -DgroupId=org.ploin -DartifactId=demoSpringMvcJpa

This archetype shows how the REST is working in Spring 3 and how you can use it together with JPA 1.0.

SpringMvc + Spring 3.0.0.RELEASE

This maven2 archetype contains a little sample application with the new Spring 3.0 RC1 Framework and Spring Mvc. It is deployed on the PLOIN Repository-Server on

http://www.ploin-m2.de/nexus/content/groups/public/

you can create a project from the archetype with the following command:

mvn archetype:generate -DarchetypeGroupId=org.ploin.archetype -DarchetypeArtifactId=tempSpringMvc -DarchetypeVersion=1.2 -DarchetypeRepository=http://www.ploin-m2.de/nexus/content/groups/public/ -DgroupId=de.ploin -DartifactId=demoSpringMvc