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

JSF h:inputFile use cases throw exception when the form is submitted without a file

    Details

      Description

      Steps to reproduce:

      1. Navigate to the h:inputFile General example.
      2. Click the Submit button.

      If the bug still exist, the following error message will appear in the browser:

      type Exception report
      
      message javax.el.ELException: /WEB-INF/component/h/inputfile/general/inputFile.xhtml @8,69 value="#{htmlInputFileBackingBean.uploadedPart}": Error writing 'uploadedPart' on type com.liferay.faces.showcase.bean.HtmlInputFileBackingBean
      
      description The server encountered an internal error that prevented it from fulfilling this request.
      
      exception
      
      javax.servlet.ServletException: javax.el.ELException: /WEB-INF/component/h/inputfile/general/inputFile.xhtml @8,69 value="#{htmlInputFileBackingBean.uploadedPart}": Error writing 'uploadedPart' on type com.liferay.faces.showcase.bean.HtmlInputFileBackingBean
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:671)
          org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
      
      root cause
      
      javax.faces.component.UpdateModelException: javax.el.ELException: /WEB-INF/component/h/inputfile/general/inputFile.xhtml @8,69 value="#{htmlInputFileBackingBean.uploadedPart}": Error writing 'uploadedPart' on type com.liferay.faces.showcase.bean.HtmlInputFileBackingBean
          javax.faces.component.UIInput.updateModel(UIInput.java:866)
          javax.faces.component.UIInput.processUpdates(UIInput.java:749)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIForm.processUpdates(UIForm.java:281)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1254)
          com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
          com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
          com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
          org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
      
      root cause
      
      javax.el.ELException: /WEB-INF/component/h/inputfile/general/inputFile.xhtml @8,69 value="#{htmlInputFileBackingBean.uploadedPart}": Error writing 'uploadedPart' on type com.liferay.faces.showcase.bean.HtmlInputFileBackingBean
          com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:139)
          javax.faces.component.UIInput.updateModel(UIInput.java:832)
          javax.faces.component.UIInput.processUpdates(UIInput.java:749)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIForm.processUpdates(UIForm.java:281)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1254)
          com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
          com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
          com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
          org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
      
      root cause
      
      javax.el.ELException: Error writing 'uploadedPart' on type com.liferay.faces.showcase.bean.HtmlInputFileBackingBean
          javax.el.BeanELResolver.setValue(BeanELResolver.java:131)
          com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255)
          com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281)
          org.apache.el.parser.AstValue.setValue(AstValue.java:202)
          org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:257)
          com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:131)
          javax.faces.component.UIInput.updateModel(UIInput.java:832)
          javax.faces.component.UIInput.processUpdates(UIInput.java:749)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIForm.processUpdates(UIForm.java:281)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1254)
          com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
          com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
          com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
          org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
      
      root cause
      
      java.lang.NullPointerException
          com.liferay.faces.showcase.dto.UploadedFilePart.<init>(UploadedFilePart.java:53)
          com.liferay.faces.showcase.dto.UploadedFilePart.<init>(UploadedFilePart.java:44)
          com.liferay.faces.showcase.bean.HtmlInputFileBackingBean.setUploadedPart(HtmlInputFileBackingBean.java:94)
          sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          java.lang.reflect.Method.invoke(Method.java:498)
          javax.el.BeanELResolver.setValue(BeanELResolver.java:127)
          com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255)
          com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281)
          org.apache.el.parser.AstValue.setValue(AstValue.java:202)
          org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:257)
          com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:131)
          javax.faces.component.UIInput.updateModel(UIInput.java:832)
          javax.faces.component.UIInput.processUpdates(UIInput.java:749)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIForm.processUpdates(UIForm.java:281)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1291)
          javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1254)
          com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
          com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
          com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
          org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145)
          com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:137)
      
      note The full stack trace of the root cause is available in the Apache Tomcat/8.0.32 logs.
      

        Attachments

          Activity

            People

            Assignee:
            kyle.stiemann Kyle Stiemann (Inactive)
            Reporter:
            kyle.stiemann Kyle Stiemann (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                showcase-2.0.1
                showcase-3.0.1