8 Replies Latest reply on Jun 1, 2012 12:55 PM by NIranjan Nanda

    JBoss 7.1.1.Final issue with Spring 3.1.1

    NIranjan Nanda Apprentice

      Hi All,

       

      We are using Spring 3.1.1 and JBoss 7.1.1.Final for our web application. My web.xml looks like below:

       

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          id="WebApp_ID" version="2.5">
      
          <context-param>
              <param-name>contextConfigLocation</param-name>
              <param-value>classpath:spring/applicationContext.xml</param-value>
          </context-param>
      
          <!-- Listeners are loaded in the sequence mentioned in web.xml -->
          <listener>
              <description>Spring Application Context listener. This must be loaded first</description>
              <display-name>Spring Context Config Listener</display-name>
              <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
          </listener>
          <listener>
              <description>JAX-WS Listener. This will initialize Metro web service engine</description>
              <display-name>JAX-WS Listener</display-name>
              <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
          </listener>
      
          <servlet>
              <servlet-name>JAX-WS Servlet</servlet-name>
              <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
              <load-on-startup>2</load-on-startup>
          </servlet>
      
          <servlet>
             <servlet-name>RESTful Servlet</servlet-name>
             <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
      
             <init-param>
                 <param-name>com.sun.ws.rest.config.property.resourceConfigClass</param-name>
                 <param-value>com.demo.util.ws.restful.config.DemoRestfulResourcesConfig</param-value>
             </init-param>
             <init-param>
                 <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
                 <param-value>com.demo.util.ws.handler.DemoRestfulRequestHandler</param-value>
             </init-param>
             <load-on-startup>3</load-on-startup>
          </servlet>
      
          <servlet-mapping>
              <servlet-name>JAX-WS Servlet</servlet-name>
              <url-pattern>/ws/*</url-pattern>
          </servlet-mapping>
      
          <servlet-mapping>
             <servlet-name>RESTful Servlet</servlet-name>
             <url-pattern>/restful/*</url-pattern>
          </servlet-mapping>
      
      </web-app>
      

       

      This clearly tells to load Spring context listener before Sun-Metro listener. However, JBoss 7 is loading Sun Metro servlet/listener before Spring context listener.

       

      This works perfectly fine in JBoss 5.1.

       

      Am I doing something wrong? Why JBoss 7 is behaving weirdly?

       

      Thanks,

      Niranjan