1 Reply Latest reply on Jun 26, 2008 11:44 PM by bouba331

    Spring & No WebApplicationContext found

    bouba331

      Hi,


      I have already read multiple messages about this problem but found no solution.


      I want to use my spring services with Seam but I always have this exception:


      javax.servlet.ServletException: No WebApplicationContext found: no ContextLoaderListener registered?
              javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
              org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


      Ok, so it appears that Seam does not load my Spring application context. I've tried everything:


      -------------------------------------------------------------------------------


      without any applicationContext.xml


      <!-- components.xml -->
      <spring:context-loader>
        <spring:config-locations>
          <value>classpath:daos.xml</value>
          <value>classpath:services.xml</value>
          <value>classpath:servlets.xml</value>
        </spring:config-locations>
      </spring:context-loader>



      -------------------------------------------------------------------------------



      <!-- components.xml -->
      <spring:context-loader/>
      



      or


      <!-- components.xml -->
      <spring:context-loader config-locations="/WEB-INF/applicationContext.xml">
      



      or



      <!-- components.xml -->
      <spring:context-loader configLocation="/WEB-INF/applicationContext.xml">
      



      with this applicationContext.xml


      <!-- applicationContext.xml in the WEB-INF directory of my WAR -->
      
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
      
        <import resource="classpath*:daos.xml" />
        <import resource="classpath*:classpath:services.xml" />
        <import resource="classpath*:servlets.xml" />
      
      </beans>
      



      -------------------------------------------------------------------------------


      Nothing works !


      So, do you know what is the problem ?


      Thanks.