Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-1720

NullPointerException thrown by PrimeFaces CoreRenderer on WebLogic

    Details

      Description

      According to forum posts like the one titled NPE in case of exception during ajax request and PrimeFaces Issue#5141 the RequestContext attribute can sometimes be null. Since it has only been observed with PrimeFaces portlets running on WebLogic, it might be caused by the way WebLogic handles serialization/deserialization of request attributes. The NullPointerException occurs at the following block of code in the PrimeFaces CoreRenderer class:

      protected WidgetBuilder getWidgetBuilder(FacesContext context) {
          return ((RequestContext) context.getAttributes().get(Constants.REQUEST_CONTEXT_ATTR)).getWidgetBuilder();
      }
      

      Steps to Reproduce:

      1. Deploy the primefaces3-portlet on WebLogic

      2. Add the "PrimeFaces3" portlet to a portal page.

      3. Click on the "Show Comments" link

      If the bug still exists, then the following exception will appear in the WebLogic console log:

      Sep 2, 2013 4:28:28 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
      SEVERE: Error Rendering View[/views/portletViewMode.xhtml]
      java.lang.NullPointerException
      	at org.primefaces.renderkit.CoreRenderer.getWidgetBuilder(CoreRenderer.java:481)
      	at org.primefaces.component.inputtextarea.InputTextareaRenderer.encodeScript(InputTextareaRenderer.java:101)
      	at org.primefaces.component.inputtextarea.InputTextareaRenderer.encodeEnd(InputTextareaRenderer.java:71)
      	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:881)
      	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
      	at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:513)
      	at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
      	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1612)
      	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
      	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
      	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
      	at javax.faces.component.UIForm.visitTree(UIForm.java:371)
      	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
      	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
      	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
      	at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
      	at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:378)
      	at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:298)
      	at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
      	at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:973)
      	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
      	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:413)
      	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
      	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
      	at com.liferay.faces.bridge.application.ViewHandlerCompatImpl.renderView(ViewHandlerCompatImpl.java:35)
      	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      	at com.liferay.faces.bridge.BridgePhaseResourceImpl.execute(BridgePhaseResourceImpl.java:104)
      	at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:128)
      	at javax.portlet.faces.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:178)
      

        Attachments

          Activity

            People

            • Assignee:
              neil.griffin Neil Griffin
              Reporter:
              neil.griffin Neil Griffin
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                liferay-faces-3.0.3-legacy-ga4
                liferay-faces-3.0.3-ga4
                liferay-faces-3.1.3-ga4