9 Replies Latest reply on Jan 4, 2016 5:28 PM by Tomaz Cerar

    ServletContext getResourceAsStream broken with latest Wildfly 10.0.0.CR5

    Alban Chadenas Newbie

      Hi,

       

      I hope someone can help.

       

      We have a legacy application that is using struts 1. The application has been running fine from Jboss 3.2.x to the previous Wildfly 10.0.0 CR4 including EAP 4 / 5 and 6 releases.

       

      However something has changed in the latest Wildfly 10 CR5 release. The default ActionServlet fails to initialize. Looking at the struts 1.3.10 source code, the servlet fails to read the /WEB-INF/web.xml throwing the following exception:

      12:22:24,722 ERROR [org.apache.struts.action.ActionServlet] (ServerService Thread Pool -- 100) Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable.  Most likely, this is due to an incorrect or missing library dependency.: javax.servlet.ServletException: The /WEB-INF/web.xml was not found.

          at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1781)

          at org.apache.struts.action.ActionServlet.init(ActionServlet.java:349)

          at javax.servlet.GenericServlet.init(GenericServlet.java:244)

       

      ActionServlet.java source code - line 1781:

       

      InputStream input =
           getServletContext().getResourceAsStream("/WEB-INF/web.xml");
      if (input == null) {
           log.error(internal.getMessage("configWebXml"));
           throw new ServletException(internal.getMessage("configWebXml"));
      }
      
      

       

       

      The web application is packaged inside an exploded ear file with the following simplified structure:

           myAppp.ear (exploded)

                |--- myEjbs.jar

                |--- myWebApp.war (exploded)

                |          |--- WEB-INF

                |                    |-- web.xml

                |                    |--- lib

                |                           |--- struts.jar

                |--- META-INF

                          |--- application.xml

       

      The application.xml contains the following modules:

      <module>
        <ejb>myEjbs.jar</ejb>
      </module>
      <module>
        <web>
          <web-uri>myWebApp.war</web-uri>
          <context-root>myWebApp</context-root> 
        </web>
      </module>
      
      

       

      This seems to be a bug to me unless there are new configuration changes required in this latest release to allow a servlet accessing a resource?

       

      Thanks in advance,

      Alban