title: Maven multiproject eclipse import gets all references right but misses them at runtime.
body: <p>Hello all I'm trying to get started with maven and eclipse.</p>
  
  <p>I have some experience with spring, hibernate and maven for a single maven project so far.  What I try to achieve is to separate my project into 3 projects representing the classic layers. Web, Service and DAO. I want to build a proper project stub managed by maven. 
  To get started I created the Web project and the DAO project and I'm already hitting a wall. My maven project has the following structure:</p>
  
  <pre><code>-SuperProject
  --Web
  --DAO
  </code></pre>
  
  <p>Here is the pom of the parent:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.maventest01.test01&lt;/groupId&gt;
    &lt;artifactId&gt;test01&lt;/artifactId&gt;
    &lt;packaging&gt;pom&lt;/packaging&gt;
  
    &lt;properties&gt;
      &lt;junit.version&gt;4.11&lt;/junit.version&gt;
      &lt;jdk.version&gt;1.7&lt;/jdk.version&gt;
      &lt;test01-data.version&gt;1.0&lt;/test01-data.version&gt;
    &lt;/properties&gt;
  
    &lt;modules&gt;
  
    &lt;module&gt;../test01-data&lt;/module&gt;
    &lt;module&gt;../test01-web&lt;/module&gt;
  
    &lt;/modules&gt;
  
    &lt;version&gt;1.0&lt;/version&gt;
    &lt;name&gt;test01&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  
    &lt;dependencyManagement&gt;
    &lt;dependencies&gt;
  
  
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;${junit.version}&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
    &lt;!-- test01-data Dependecies --&gt;
      &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-c3p0&lt;/artifactId&gt;
              &lt;version&gt;4.2.5.Final&lt;/version&gt;
      &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;4.2.5.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;version&gt;4.2.5.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.common&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt;
              &lt;version&gt;4.0.2.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.1.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.26&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
              &lt;version&gt;1.9.13&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
      &lt;!-- test01-web Dependencies --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
             &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
             &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
             &lt;version&gt;2.5&lt;/version&gt;
             &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
    &lt;dependency&gt;
           &lt;groupId&gt;org.springframework&lt;/groupId&gt;
           &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
           &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
    &lt;/dependency&gt;
  
    &lt;dependency&gt;
           &lt;groupId&gt;org.springframework&lt;/groupId&gt;
           &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
           &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
    &lt;/dependency&gt;
  
    &lt;dependency&gt;
           &lt;groupId&gt;org.springframework&lt;/groupId&gt;
           &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
           &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
         &lt;groupId&gt;org.springframework&lt;/groupId&gt;
         &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
         &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
         &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
         &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
         &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
         &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
         &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
         &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
         &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
         &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
         &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;
  
  
    &lt;build&gt;
  
    &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;${jdk.version}&lt;/source&gt;
                      &lt;target&gt;${jdk.version}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
    &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is the pom of the web layer:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.maventest01.test01.web&lt;/groupId&gt;
    &lt;artifactId&gt;test01-web&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;1.0&lt;/version&gt;
    &lt;name&gt;test01-web&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;parent&gt;
    &lt;groupId&gt;com.maventest01.test01&lt;/groupId&gt;
    &lt;artifactId&gt;test01&lt;/artifactId&gt;
    &lt;relativePath&gt;../test01&lt;/relativePath&gt;
    &lt;version&gt;1.0&lt;/version&gt;
    &lt;/parent&gt;
  
    &lt;properties&gt;
      &lt;junit.version&gt;4.11&lt;/junit.version&gt;
      &lt;jdk.version&gt;1.7&lt;/jdk.version&gt;
      &lt;test01-data.version&gt;1.0&lt;/test01-data.version&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
  
      &lt;dependency&gt;
            &lt;groupId&gt;junit&lt;/groupId&gt;
            &lt;artifactId&gt;junit&lt;/artifactId&gt;
            &lt;version&gt;${junit.version}&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
            &lt;groupId&gt;com.maventest01.test01.data&lt;/groupId&gt;
            &lt;artifactId&gt;test01-data&lt;/artifactId&gt;
            &lt;version&gt;${test01-data.version}&lt;/version&gt;
      &lt;/dependency&gt; 
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
            &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
            &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
            &lt;version&gt;2.5&lt;/version&gt;
            &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
          &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
    &lt;/dependency&gt;  
    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
      &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
          &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
          &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
          &lt;version&gt;3.1.4.RELEASE&lt;/version&gt;
    &lt;/dependency&gt;
  
  
    &lt;/dependencies&gt;
  
  
    &lt;build&gt;
  
          &lt;plugins&gt;
  
          &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;              &lt;configuration&gt;
                      &lt;source&gt;${jdk.version}&lt;/source&gt;
                      &lt;target&gt;${jdk.version}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.9&lt;/version&gt;
                  &lt;configuration&gt;
  
                          &lt;wtpversion&gt;2.0&lt;/wtpversion&gt;
  
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is the pom of DAO layer:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.maventest01.test01.data&lt;/groupId&gt;
      &lt;artifactId&gt;test01-data&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0&lt;/version&gt;
      &lt;name&gt;test01-data&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.maventest01.test01&lt;/groupId&gt;
          &lt;artifactId&gt;test01&lt;/artifactId&gt;
          &lt;relativePath&gt;../test01&lt;/relativePath&gt;
          &lt;version&gt;1.0&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;junit.version&gt;4.11&lt;/junit.version&gt;
          &lt;jdk.version&gt;1.7&lt;/jdk.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${junit.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-c3p0&lt;/artifactId&gt;
              &lt;version&gt;4.2.5.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;4.2.5.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;version&gt;4.2.5.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.common&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt;
              &lt;version&gt;4.0.2.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.1.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.26&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
              &lt;version&gt;1.9.13&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
  
  
  
      &lt;build&gt;
  
          &lt;finalName&gt;${artifactId}&lt;/finalName&gt;
  
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;${jdk.version}&lt;/source&gt;
                      &lt;target&gt;${jdk.version}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Once I completed the pom files I did a </p>
  
  <pre><code>mvn install 
  </code></pre>
  
  <p>then a</p>
  
  <pre><code>mvn eclipse:eclipse
  </code></pre>
  
  <p>After this I imported the 3 projects in Eclipse. As existing java projects not as maven projects. (I want to use maven independently from eclipse and vice versa).</p>
  
  <p>Now by checking the deployment assembly of the eclipse project all jars are properly referenced as well as the DAO project. The only thing I needed to do is add the DAO project to the Tomcat classpath. So far everything seemed ok. </p>
  
  <p>To test this configuration i'm building a simple login form. In the web project the controller returning the index page I create an instance of UserDAO because I figured this triggers an the Exception. 
  See the controller code and the dispatcher-servlet.xml:</p>
  
  <p>Controller:</p>
  
  <pre><code>package com.maventest01.test01.web.controllers;
  
  import javax.servlet.http.HttpSession;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.ModelMap;
  import org.springframework.web.bind.annotation.ModelAttribute;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  
  import com.maventest01.test01.data.dao.impl.UserDAO;
  import com.maventest01.test01.data.model.UserEntity;
  
  @Controller
  public class IndexController {
  
      @RequestMapping(value = "/index.html", method = RequestMethod.GET)
      public String getIndexPage(ModelMap model) {
  
              UserDAO userdao = new UserDAO();
          model.addAttribute("user", new UserEntity());
  
          return "index";
      }    
  }
  </code></pre>
  
  <p>dispatcher-servlet:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:util="http://www.springframework.org/schema/util"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans     
          http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
          http://www.springframework.org/schema/context 
          http://www.springframework.org/schema/context/spring-context-3.2.xsd
          http://www.springframework.org/schema/mvc
          http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
          http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd"&gt;
  
  
      &lt;context:component-scan base-package="com.maventest01.test01.web" /&gt;
  
      &lt;bean
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix"&gt;
              &lt;value&gt;/WEB-INF/views/&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="suffix"&gt;
              &lt;value&gt;.jsp&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Eclipse gives no errors, but at runtime I get the exception:</p>
  
  <pre><code>org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:972)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  
  root cause
  
  java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion
      com.maventest01.test01.web.controllers.IndexController.getIndexPage(IndexController.java:19)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:606)
      org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  </code></pre>
  
  <p>It seems to me at runtime at server level the dependencies are not available anymore. Now if I want to inject the DAO using the @Autowired annotation and by adding the following line to the dispatcher-servlet </p>
  
  <pre><code>&lt;bean id="userDAO" class="com.maventest01.test01.data.dao.impl.UserDAO" /&gt;
  </code></pre>
  
  <p>I have the exception:</p>
  
  <pre><code>WARNING: Exception thrown from LifecycleProcessor on context close
  java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Mon Dec 30 16:26:37 CET 2013]; root of context hierarchy
      at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:353)
      at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1045)
      at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1000)
      at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:554)
      at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
      at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4980)
      at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5626)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:724)
  </code></pre>
  
  <p>Again it seems to me spring cannot find the DAO project. Because if I remove the line:</p>
  
  <p>from the dispatcher-servlet.xml the code runs. But of course cannot work because the DAO piece is missing. </p>
  
  <p>So what am I missing? I feel like I messed up some pom configuration. Somehow the DAO pom is not available to the tomcat even it is referenced in the deployment assembly of the web project. </p>