3 Replies Latest reply on Mar 25, 2008 5:29 AM by Kerdudou Ronan

    fileupload 3.2 problem

    I B Newbie

      i'm running myfaces 1.2 and facelets 1.13 seam 2.0 and i have problems with the fileupload component...first

      this code from the myfaces causes my app to blow up:
      /**
      * Check the submitted form parameters for data associated with this
      * component. This default implementation delegates to this component's
      * renderer if there is one, and otherwise ignores the call.
      */
      public void decode(FacesContext context)
      {
      if (context == null) throw new NullPointerException("context");
      try
      {
      Renderer renderer = getRenderer(context);
      if (renderer != null)
      {
      renderer.decode(context, this);
      }
      }
      catch(Exception ex) {
      throw new FacesException("Exception while decoding component : "+getPathToComponent(this), ex);
      }
      }

      the ERROR:

      15:36:57,651 ERROR [_ErrorPageWriter] An exception occurred
      javax.faces.FacesException: Exception while decoding component : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /jsp/searchMaintReq.xhtml][Class: javax.faces.component.html.HtmlPanelGrid,Id: j_id33][Class: javax.faces.component.html.HtmlPanelGrid,Id: j_id35][Class: javax.faces.component.html.HtmlForm,Id: searchForm][Class: org.richfaces.component.html.HtmlPanel,Id: upload_panel][Class: org.richfaces.component.html.HtmlFileUpload,Id: fileUploadId]}
      at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:515)
      at javax.faces.component.UIInput.decode(UIInput.java:184)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:641)
      at javax.faces.component.UIInput.processDecodes(UIInput.java:114)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:637)
      at javax.faces.component.UIForm.processDecodes(UIForm.java:57)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:637)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:637)
      at org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:380)
      at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:233)
      at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:397)
      at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:32)
      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:80)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:143)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:276)
      at org.ajax4jsf.Filter.doFilter(Filter.java:165)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException
      at org.richfaces.renderkit.FileUploadRendererBase.doDecode(FileUploadRendererBase.java:115)
      at org.ajax4jsf.renderkit.RendererBase.decode(RendererBase.java:76)
      at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:511)
      ... 43 more


      The second problem is that the fileUploadListener doesnt get fired after the file is uploaded and i loose the buttons to add another file only options i have is clear all...

      Anybody knows hot to resolve this???