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

Exception occurs when executing a form which includes rich:fileUpload

    Details

      Description

      {markdown}
      When a form including a `rich:fileUpload` component is submitted by a component other than the `rich:fileUpload`, the following exception occurs:

      18:21:23,379 ERROR [FileUploadRendererRichFacesImpl:107]
      java.lang.NullPointerException
      at com.liferay.faces.bridge.context.map.internal.ContextMapFactoryImpl.getUploadedFileMap(ContextMapFactoryImpl.java:171)
      at com.liferay.faces.bridge.renderkit.richfaces.internal.FileUploadRendererRichFacesImpl.decode(FileUploadRendererRichFacesImpl.java:77)
      at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1183)
      at javax.faces.component.UIForm.processDecodes(UIForm.java:225)
      at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:534)
      at org.richfaces.context.MetaComponentProcessingVisitCallback.visit(MetaComponentProcessingVisitCallback.java:73)
      at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:103)
      at org.richfaces.context.ExtendedExecuteVisitContext.invokeVisitCallback(ExtendedExecuteVisitContext.java:55)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1652)
      at javax.faces.component.UIForm.visitTree(UIForm.java:371)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
      ...

      Steps to reproduce:

      1. Build and deploy the RichFacesFileUploadTestPortlet portlet.
      2. Add the portlet to a page.
      3. Click the inc button.

      If the bug still exists, the above stacktrace will be shown in the logs.

      For comparison, I have attached a webapp version of the test (RichFacesFileUploadTest) which works without throwing an exception.

      Workarounds:

      - Place the `rich:fileUpload` in a seperate `h:form` than other components.
      - If you are submitting the form via Ajax, consider changing `execute="@form"` to something more specific which does not include the `rich:fileUpload` component.{markdown}

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                liferay-faces-2.1.5-ga6
                liferay-faces-2.2.5-ga6
                liferay-faces-3.0.5-legacy-ga6
                liferay-faces-3.0.5-ga6
                liferay-faces-3.1.5-ga6
                liferay-faces-3.2.5-ga6
                liferay-faces-4.2.5-ga6