Forums

angle-left Back

p:fileupload - ArrayIndexOutOfBoundsException

MD
Mauro D'Uva, modified 7 Months ago.

p:fileupload - ArrayIndexOutOfBoundsException

New Member Posts: 1 Join Date: 6/8/15 Recent Posts
We have an issue using p:fileupload tag. The page is displayed correctly and everything works fine, but when the file is uploaded, it creates the following error message in the logs:

Exception:
Nov 09, 2017 2:16:59 PM com.liferay.faces.bridge.context.map.RequestParameterMapMultiPartImpl <init>
SEVERE: Array index out of range: 2
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 2
        at com.liferay.faces.bridge.context.map.NamespacedParameterMap.append(NamespacedParameterMap.java:44)
        at com.liferay.faces.bridge.context.map.RequestParameterMapMultiPartImpl.<init>(RequestParameterMapMultiPartImpl.java:283)
        at com.liferay.faces.bridge.context.map.RequestParameterMapFactory.<init>(RequestParameterMapFactory.java:50)
        at com.liferay.faces.bridge.context.BridgeContextImpl.getRequestParameterMapFactory(BridgeContextImpl.java:1012)
        at com.liferay.faces.bridge.context.BridgeContextImpl.getRequestParameterMap(BridgeContextImpl.java:1003)
        at com.liferay.faces.bridge.context.BridgeContextImpl.getRequestHeaderValuesMap(BridgeContextImpl.java:992)
        at com.liferay.faces.bridge.context.BridgeContextImpl.getRequestHeaderMap(BridgeContextImpl.java:982)
        at com.liferay.faces.bridge.context.ExternalContextImpl.getRequestHeaderMap(ExternalContextImpl.java:449)
        at com.sun.faces.context.PartialViewContextImpl.isAjaxRequest(PartialViewContextImpl.java:111)
        at javax.faces.context.PartialViewContextWrapper.isAjaxRequest(PartialViewContextWrapper.java:117)
        at org.primefaces.context.PrimePartialViewContext.isAjaxRequest(PrimePartialViewContext.java:80)
        at com.sun.faces.context.ExceptionHandlerFactoryImpl.getExceptionHandler(ExceptionHandlerFactoryImpl.java:65)
        at com.liferay.faces.bridge.context.ExceptionHandlerFactoryImpl.getExceptionHandler(ExceptionHandlerFactoryImpl.java:36)
        at com.wcb.common.web.app.error.CustomExceptionHandlerFactory.getExceptionHandler(CustomExceptionHandlerFactory.java:20)
        at com.sun.faces.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:93)
        at org.primefaces.context.PrimeFacesContextFactory.getFacesContext(PrimeFacesContextFactory.java:28)
        at com.sun.faces.context.InjectionFacesContextFactory.getFacesContext(InjectionFacesContextFactory.java:121)
        at com.liferay.faces.bridge.BridgePhaseBaseImpl.getFacesContext(BridgePhaseBaseImpl.java:356)
        at com.liferay.faces.bridge.BridgePhaseBaseImpl.init(BridgePhaseBaseImpl.java:188)
        at com.liferay.faces.bridge.BridgePhaseResourceImpl.execute(BridgePhaseResourceImpl.java:56)
        at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:128)
        at javax.portlet.faces.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:178)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:122)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:82)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:116)
        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
        at java.lang.reflect.Method.invoke(Method.java:620)
        at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
        at com.sun.proxy.$Proxy917.doFilter(Unknown Source)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
        at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:74)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:117)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
.

xhtml excerpt:
<p:fileUpload update="@form" value="#{batchUploadInvoiceBean.uploadedFile}"
                mode="advanced" allowTypes="/(\.|\/)(xml)$/" label="Browse"
                fileUploadListener="#{batchUploadInvoiceBean.upload}" />


We are using Liferay 6.2 GA1 and liferay-faces-bridge-impl-3.2.4-ga5.jar. Hpw do we get rid of the error message?

Thanks
Mauro
Neil Griffin, modified 7 Months ago.

RE: p:fileupload - ArrayIndexOutOfBoundsException

LIFERAY STAFF Liferay Legend Posts: 2540 Join Date: 7/26/05 Recent Posts
Hi Mauro,

Please upgrade to our latest Liferay Faces dependencies and see if the problem goes away. You can determine the dependencies using the dropdown list at http://www.liferayfaces.org/

Kind Regards,

Neil