7 Replies Latest reply on Feb 4, 2012 12:57 PM by motteRobo motte

    rich:fileupload

    motteRobo motte Newbie

      Hi All,

       

      I have an issue with rich file upload randomly i am getting an error in upload popup "Transfer error occured", in the server it is throwing the following exception

      Apr 18, 2011 5:23:34 PMcom.sun.facelets.FaceletViewHandler handleRenderException

      SEVERE: Error RenderingView[/pages/creditNote/creditNote.jspx]

      java.lang.ArrayIndexOutOfBoundsException: 6

            atjava.util.ArrayList.add(ArrayList.java:352)

            atjavax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1663)

            atjavax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1526)

            atcom.sun.facelets.tag.jsf.ComponentSupport.markForDeletion(ComponentSupport.java:221)

            at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:137)

            atcom.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)

            atcom.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)

            atcom.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)

            atcom.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)

            atcom.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)

            atcom.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)

            atcom.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)

            atcom.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)

            atcom.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)

            atcom.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:310)

            atcom.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:280)

            atcom.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)

            atcom.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)

            atcom.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)

            atcom.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)

       

       

       

      code snippnet is as follows

      --------------------------------------

      <rich:fileUpload id="attachment" rendered="#{!multipleCreditnote.multipleCN.disableAllFields}"

                                                                                                addControlLabel="#{message['button.addfile']}"

                                                                                                uploadControlLabel="#{message['button.attach']}"

                                                                                                acceptedTypes="doc,xls,pst,ppt,txt,csv,jpg,gif,bmp,png,tif,tiff,pdf,msg"

                                                                                                maxFilesQuantity="5" uploadData="#{multipleCreditnote.multipleCN.tempCN.uploadedFiles}"

                                                                                                noDuplicate="true" transferErrorLabel="Error during file upload. Clear and try again.">

                                                                                                <a4j:support event="onuploadcomplete"

                                                                                                          reRender="upInfo,info,fileErrorId,fileErrorMessages,fileErrorMessages1,dataOutputPanel"

                                                                                                          actionListener="#{multipleCreditnote.saveUploadedItems}"

                                                                                                          ajaxSingle="true" />

                                                                                                <a4j:support event="onclear"

                                                                                                          actionListener="#{multipleCreditnote.clearUploadedItems}">

                                                                                                </a4j:support>

                                                                                      </rich:fileUpload>

       

      web.xml

      ----------

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                id="WebApp_ID" version="2.5">

                <display-name>creditnote</display-name>

                <context-param>

                          <param-name>contextConfigLocation</param-name>

                          <param-value>/WEB-INF/classes/applicationContext.xml</param-value>

                </context-param>

                <listener>

                          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

                </listener>

                <description>SMX Credit Note Application</description>

                <context-param>

                          <description>Comma seperated list of &quot;View Handlers&quot;. &quot;ajax4jsf&quot;

                                    is always the first handler in the chain. </description>

          <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>

          <param-value>com.sun.facelets.FaceletViewHandler</param-value>

        </context-param>

        <context-param>

          <param-name>com.sun.faces.disableUnicodeEscaping</param-name>

          <param-value>true</param-value>

        </context-param>

        <context-param>

          <description>Specifies the suffix for the page</description>

          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

          <param-value>.jspx</param-value>

        </context-param>

        <context-param>

          <description>xHtml page refresh</description>

          <param-name>facelets.REFRESH_PERIOD</param-name>

          <param-value>2</param-value>

        </context-param>

        <context-param>

                    <description>EL expressions in comments are not evaluated</description>

              <param-name>facelets.SKIP_COMMENTS</param-name>

              <param-value>true</param-value>

        </context-param>

        <context-param>

          <description>Enabling Facelets debug logging during

                                    development</description>

          <param-name>facelets.DEVELOPMENT</param-name>

          <param-value>true</param-value>

        </context-param>

        <context-param>

          <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

          <param-value>server</param-value>

        </context-param>

        <context-param>

          <param-name>com.sun.faces.validateXml</param-name>

          <param-value>true</param-value>

        </context-param>

        <context-param>

          <param-name>com.sun.faces.verifyObjects</param-name>

          <param-value>false</param-value>

        </context-param>

        <context-param>

          <description>Specifies the Skin to be used</description>

          <param-name>org.richfaces.SKIN</param-name>

          <param-value>blueSky</param-value>

        </context-param>

        <context-param>

          <description>It doesn't allow A4J to reformat JavaScript files.</description>

          <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>

          <param-value>true</param-value>

        </context-param>

        <context-param>

          <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>

          <param-value>true</param-value>

        </context-param>

        <context-param>

          <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>

          <param-value>NONE, NEKO, TIDY</param-value>

        </context-param>

        <context-param>

          <param-name>org.richfaces.CONTROL_SKINNING</param-name>

          <param-value>enable</param-value>

        </context-param>

        <context-param>

          <param-name>org.richfaces.LoadStyleStrategy</param-name>

          <param-value>ALL</param-value>

        </context-param>

        <context-param>

          <param-name>org.richfaces.LoadScriptStrategy</param-name>

          <param-value>ALL</param-value>

        </context-param>

        <context-param>

          <description>FCK Editor configuration</description>

          <param-name>org.fckfaces.CUSTOM_CONFIGURATIONS_PATH</param-name>

          <param-value>/fckeditor/fckconfig.js</param-value>

        </context-param>

        <filter>

          <display-name>Ajax4jsf Filter</display-name>

          <filter-name>ajax4jsf</filter-name>

          <filter-class>org.ajax4jsf.Filter</filter-class>

          <init-param>

            <param-name>createTempFiles</param-name>

            <param-value>true</param-value>

          </init-param>

          <init-param>

            <param-name>maxRequestSize</param-name>

            <param-value>10485760</param-value>

          </init-param>

        </filter>

        <filter>

          <filter-name>Acegi Filter Chain Proxy</filter-name>

          <filter-class>

                          org.springframework.security.util.FilterToBeanProxy

                </filter-class>

          <init-param>

            <param-name>targetClass</param-name>

            <param-value>

                                    org.springframework.security.util.FilterChainProxy

                          </param-value>

          </init-param>

        </filter>

       

       

       

      <filter>

                <filter-name>Compress</filter-name>

                <filter-class>com.sony.cn.filters.GZIPFilter</filter-class>

      </filter>

       

      <filter-mapping>

          <filter-name>ajax4jsf</filter-name>

          <servlet-name>Faces Servlet</servlet-name>

          <url-pattern>*</url-pattern>

          <dispatcher>FORWARD</dispatcher>

          <dispatcher>REQUEST</dispatcher>

          <dispatcher>INCLUDE</dispatcher>

          <dispatcher>ERROR</dispatcher>

        </filter-mapping>

       

      <filter-mapping>

                <filter-name>Compress</filter-name>

                <url-pattern>*.css</url-pattern>

      </filter-mapping>

       

       

      <filter-mapping>

                <filter-name>Compress</filter-name>

                <url-pattern>*.js</url-pattern>

      </filter-mapping>

       

       

       

        <filter-mapping>

          <filter-name>Acegi Filter Chain Proxy</filter-name>

          <url-pattern>/*</url-pattern>

        </filter-mapping>

      <error-page>

          <error-code>401</error-code>

          <location>/pages/errors/error.html</location>

        </error-page>

        <error-page>

          <error-code>403</error-code>

          <location>/pages/errors/error.html</location>

        </error-page>

        <error-page>

          <error-code>404</error-code>

          <location>/pages/errors/error.html</location>

        </error-page>

        <error-page>

          <error-code>500</error-code>

          <location>/pages/errors/error.html</location>

        </error-page>

        <servlet>

          <servlet-name>FS</servlet-name>

          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

          <load-on-startup>1</load-on-startup>

        </servlet>

        <servlet-mapping>

          <servlet-name>FS</servlet-name>

          <url-pattern>*.faces</url-pattern>

        </servlet-mapping>

        <session-config>

          <session-timeout>10</session-timeout>

        </session-config>

        <welcome-file-list>

          <welcome-file>/index.jsp</welcome-file>

        </welcome-file-list>

      </web-app>

       

       

      Thanks for your support in advance

       

      Regards

      Motte