Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1450

NPE after redeploying a JSF portlet on JBoss AS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.1.4
    • None
    • Portlet_Support
    • None
    • JBoss 4.0 - JBoss 4.0.4

    Description

      If I have a JSF portlet, and it is given the chance to initialize the session, after redeploying the application I get an NPE:

      Caused by: java.lang.NullPointerException
      at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:393)
      at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:266)

      I have worked around the problem by creating my own portlet and overriding one function:
      (the cause of the NPE is request.getPortletSession().getAttribute(CURRENT_FACES_CONTEXT) being null after redeployment)

      protected void facesRender(RenderRequest request, RenderResponse response)
      throws PortletException, java.io.IOException {
      if (sessionTimedOut(request) || request.getPortletSession().
      getAttribute(CURRENT_FACES_CONTEXT) == null)

      { setPortletRequestFlag(request); nonFacesRequest(request, response); return; }

      super.facesRender(request, response);
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            adamw Adam Warski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: