NPE after redeploying a JSF portlet on JBoss AS
-----------------------------------------------

                 Key: MYFACES-1450
                 URL: http://issues.apache.org/jira/browse/MYFACES-1450
             Project: MyFaces Core
          Issue Type: Bug
          Components: Portlet_Support
    Affects Versions: 1.1.4
         Environment: JBoss 4.0 - JBoss 4.0.4
            Reporter: Adam Warski


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);
    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to