0 Replies Latest reply on Jul 27, 2018 4:34 AM by Manish Kumar

    404 after migrating JSF1.2 application from Jboss 4.2 to Wildfly 13

    Manish Kumar Newbie

      I am trying to migrate an existing JSF 1.2 application from Jboss 4.2 to Wildfly 13. I have also moved from jdk1.5 to jdk10. I am making an ear file with the following hierarchy:

       

      ear
       /lib ---all jars in it
       /META-INF
        /application.xml
        /jboss-deployment-structure.xml
        /MANIFEST.MF
       /EOSEJB.jar
       /EOSWeb.war

       

      My jboss-deployment-structure.xml looks like:

       

      <deployment>
        <exclude-subsystems> 
        <subsystem name="jsf" />
        </exclude-subsystems>
        <exclusions>
        <module name="com.sun.jsf-impl" />
        <module name="javax.faces.api" />
        <module name="org.jboss.as.jsf" />
        <module name="org.jboss.as.jsf-injection" />
        <module name="org.apache.commons.beanutils" />
        <module name="org.apache.commons.cli" />
        <module name="org.apache.commons.codec" />
        <module name="org.apache.commons.collections" />
        <module name="org.apache.commons.io" />
        <module name="org.apache.commons.lang" />
        <module name="org.apache.commons.lang3" />
        <module name="org.apache.commons.logging" />
        <module name="org.apache.commons.pool" />
        <module name="org.hibernate" slot="main" />
        </exclusions>
        </deployment>

         

      Same exclusions in <sub-deployment name="EOSWeb.war"> All jsf jars that I used in jboss 4.2 are in ear/lib now.

      My web.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

        <context-param>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>true</param-value>
        </context-param>

        <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
        </context-param>
        <context-param> 
        <param-name>org.apache.myfaces.COMPRESS_STATE_IN_CLIENT</param-name> 
        <param-value>true</param-value>
        </context-param>

        <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.jsp</param-value>
        </context-param>

        <!-- context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
        </context-param-->

        <!-- context-param>
        <param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
        <param-value>mojarra-1.2_15</param-value>
        </context-param-->

        <context-param>
        <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
        <param-value>true</param-value>
        </context-param>

        <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>
        /WEB-INF/faces-config.xml,
        /WEB-INF/faces-config-eos.xml,
        /WEB-INF/faces-config-pda.xml,
        /WEB-INF/faces-config-referral.xml 
        </param-value>
        </context-param>


        <!-- SERVET DEFINITIONS -->
        <servlet>
        <servlet-name>PDF Servlet</servlet-name>
        <servlet-class>org.ukt.common.PDFServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
        </servlet>
        <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
        </servlet>

        <servlet>
        <servlet-name>EOS Faces Servlet</servlet-name>
        <!-- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> -->
        <servlet-class>org.ukt.eos.util.EOSCustomFacesServlet</servlet-class>
        <init-param>
        <param-name>errorPage</param-name>
        <param-value>/faces/jsp/ErrorPage.jsp</param-value>
        </init-param>
        <load-on-startup>-1</load-on-startup>
        </servlet>


        <!-- SERVET MAPPING DEFINITIONS -->
        <servlet-mapping>
        <servlet-name>PDF Servlet</servlet-name>
        <url-pattern>/_donor_summary/*</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
        <servlet-name>EOS Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>


        <!-- WELCOME FILE DEFINITION -->
        <welcome-file-list>
        <welcome-file>jsp/login.jsp</welcome-file>
        </welcome-file-list>

        <!-- FILTER DEFINITION -->
        <filter>
        <filter-name>extensionsFilter</filter-name>
        <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
        <description>Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB</description>
        <param-name>uploadMaxFileSize</param-name>
        <param-value>100m</param-value>
        </init-param>
        <init-param>
        <description>
        Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10
        - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
        </description>
        <param-name>uploadThresholdSize</param-name>
        <param-value>100k</param-value>
        </init-param>
        </filter>

        <!-- FILTER MAPPING DEFINITION -->
        <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>/faces/*</url-pattern>
        </filter-mapping>

      <filter>
        <filter-name>SessionHandlerFilter</filter-name>
        <filter-class>org.ukt.eos.security.filters.SessionHandlerFilter</filter-class>
        <init-param>
        <param-name>session_timeout_page</param-name>
        <param-value>/faces/jsp/login.jsp</param-value>
        </init-param>
      </filter>

      <filter-mapping>
        <filter-name>SessionHandlerFilter</filter-name>
        <url-pattern>*.jsp</url-pattern>
      </filter-mapping>

      <filter>
        <filter-name>PDFRendererFilter</filter-name>
        <filter-class>org.ukt.eos.pdf.filter.PDFRendererFilter</filter-class>
      </filter>

      <filter-mapping>
        <filter-name>PDFRendererFilter</filter-name>
        <url-pattern>/_donor_summary/*</url-pattern>
      </filter-mapping>

      <!-- Filter added for security (pen test) defects
      <filter>
        <filter-name>CrossSiteScriptingFilter</filter-name>
        <filter-class>org.ukt.eos.security.filters.CrossSiteScriptingFilter</filter-class>
      </filter>

      <filter-mapping>
        <filter-name>CrossSiteScriptingFilter</filter-name>
        <url-pattern>/*</url-pattern>
      </filter-mapping>
      -->

      <session-config>
        <session-timeout>30</session-timeout>
      </session-config>


        <error-page>
        <error-code>500</error-code>
        <location>/EOSWeb/faces/jsp/ErrorPage.jsp</location>
        </error-page>

        <listener>
        <listener-class>
        org.ukt.eos.security.filters.EOSSessionListener
        </listener-class>
        </listener>
        <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
        </listener>

      </web-app>

      When I now place my ear file in standalone/deployment folder and start wildfly, it doesn't give any error in server.log. But when I hit the application url it gives me 404.

      Full server logs is available at:https://drive.google.com/file/d/1Op1MDnM3-3BnwREvOURiRBTLfBAUMBr6/view?usp=sharing