ICEmobile
  1. ICEmobile
  2. MOBI-617

Camera component does not catch IOExceptions when decoding image upload

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2 Final
    • Fix Version/s: 1.3 Beta
    • Component/s: Faces
    • Labels:
      None
    • Environment:
      n/a

      Description

      The camera component does not properly handle the IOExceptions coming from reading an image upload, as can be seen from this stack trace:

      INFO: Adapting to Thread Blocking environment
      java.lang.NullPointerException
              at org.icemobile.util.Utils.copyStream(Utils.java:94)
              at org.icefaces.mobi.utils.MobiJSFUtils.createMapOfFile(MobiJSFUtils.java:171)
              at org.icefaces.mobi.utils.MobiJSFUtils.decodeComponentFile(MobiJSFUtils.java:137)
              at org.icefaces.mobi.component.camera.CameraRenderer.extractImages(CameraRenderer.java:79)
              at org.icefaces.mobi.component.camera.CameraRenderer.decode(CameraRenderer.java:51)
              at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:787)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1181)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIForm.processDecodes(UIForm.java:225)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176)
              at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:933)
              at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at com.icesoft.servlet.MultipartFilter.doFilter(MultipartFilter.java:74)
              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:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              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:298)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
              at java.lang.Thread.run(Thread.java:662)


      The decodeComponentFile is supposed to return a boolean indicating whether the file was successfully retrieved or not, but it does not catch any IOExceptions coming from Utils.copyStream. If it did it would be able to return false to properly indicate that the upload was not successful.

        Activity

        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34732 Mon May 06 11:09:23 MDT 2013 ted.goddard file information now initialized to empty and cleared to empty (MOBI-617)
        Files Changed
        Commit graph MODIFY /icemobile/trunk/icemobile/samples/mediacast/src/main/java/org/icemobile/samples/mediacast/UploadModel.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33084 Thu Jan 17 06:35:22 MST 2013 philip.breau MOBI-617
        Camera component does not catch IOExceptions when decoding image upload
        - guard against NPE in Utils.copyStream()
        Files Changed
        Commit graph MODIFY /icemobile/trunk/icemobile/core/src/main/java/org/icemobile/util/Utils.java

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Philip Breau
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: