-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: liferay-faces-3.2.4-ga5, liferay-faces-3.2.5-ga6
-
Component/s: Liferay Faces Bridge Impl / Demos / Tests
-
Labels:None
-
Environment:Liferay Portal 6.2, RichFaces 4.5.2 Final.
{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}
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}