1

I am getting the below error after JSF 1.2 to JSF 2 migration. java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy.createView(FaceletViewHandlingStrategy.java:804) at c How is this caused and how can I solve it? I tried with 2.0.11 which allow me to login and getting different error, where as if i try with 2.2 got the below error. Attached web.xml

http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">

<display-name>sa-web</display-name>
<welcome-file-list>
    <welcome-file>/faces/pages/home.jsp</welcome-file>
</welcome-file-list>
<context-param>
    <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
    <param-value>/WEB-INF/facelet-taglib/facelets-ui.taglib.xml;/WEB-INF/facelet-taglib/shale_validation.taglib.xml;/WEB-INF/facelet-taglib/tomahawk.taglib.xml;/WEB-INF/facelet-taglib/saui.taglib.xml;/WEB-INF/facelet-taglib/radien_security.taglib.xml
    </param-value>
</context-param>
<context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config-global.xml</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>facelets.VIEW_MAPPINGS</param-name>
    <param-value>/pages/*;/templates/*;/public/*</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>
<context-param>
    <param-name>facelets.DEBUG</param-name>
    <param-value>true</param-value>
</context-param>
<context-param>
    <param-name>
        org.apache.shale.view.VIEW_CONTROLLER_MAPPER
    </param-name>
    <param-value>
        com.gmacfs.sa.web.framework.shale.ExtendedViewControllerMapper
    </param-value>
</context-param>
<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>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
</filter-mapping>

<filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter>
    <display-name>AuthenticationFilter</display-name>
    <filter-name>AuthenticationFilter</filter-name>
    <filter-class>com.gmacfs.sa.web.framework.filters.AuthenticationFilter
    </filter-class>
</filter>
<filter-mapping>
    <filter-name>AuthenticationFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
    <listener-class>com.gmacfs.sa.web.framework.listeners.ValidatorsInitializer
    </listener-class>
</listener>

<servlet>
    <servlet-name>StartupServlet</servlet-name>
    <servlet-class>com.gmacfs.sa.framework.servlets.StartupServlet
    </servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>

<servlet>
    <servlet-name>ResourceServlet</servlet-name>
    <servlet-class>com.gmacfs.sa.framework.servlets.ResourceServlet
    </servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>

<servlet>
    <servlet-name>LogoutServlet</servlet-name>
    <servlet-class>com.gmacfs.sa.framework.servlets.LogoutServlet
    </servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>ResourceServlet</servlet-name>
    <url-pattern>/resource/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>ResourceServlet</servlet-name>
    <url-pattern>/nocache-resource/*</url-pattern>
</servlet-mapping>


<servlet-mapping>
    <servlet-name>LogoutServlet</servlet-name>
    <url-pattern>/logout</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet>
    <servlet-name>Logging Servlet</servlet-name>
    <servlet-class>com.gmacfs.sa.framework.servlets.GMACLoggingServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Logging Servlet</servlet-name>
    <url-pattern>/log4j/*</url-pattern>
</servlet-mapping>
  • Please post the *web.xml* configurations for both your old JSF 1.2 project and the new JSF 2.x project. – Luiggi Mendoza Jun 17 '13 at 08:44
  • Please also tell the exact Mojarra version used in the webapp. As to your exception, the source code of the current Mojarra 2.1.22 version suggests that either `FacesContext` or `viewId` is `null`. But this is at that point somewhat strange as some prechecks are done (the line numbers in your stacktrace don't match with Mojarra 2.1.22 either). Further, are you sure that your webapp's runtime classpath isn't polluted with multiple different versioned JSF impls? This can also end up in misconfigured faces context and/or application. – BalusC Jun 17 '13 at 11:11
  • I am using 2.2 version and what i could see from my filter is throwing 500 internal server error. I am authorizing the user from weblogic security context and redirecting. I am sure i have only one version of Jsf-impl2.2.jar in my user library. – user2492619 Jun 17 '13 at 16:26
  • Is there option to attach my web.xml.. Its too big to paste the content. Is there any other way or tool to debug my exact issue causing this? – user2492619 Jun 17 '13 at 16:27

0 Answers0