Details
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.
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
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
| 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 ( |
| Files Changed | ||||
MODIFY
/icemobile/trunk/icemobile/samples/mediacast/src/main/java/org/icemobile/samples/mediacast/UploadModel.java
|
| Assignee | Steve Maryka [ steve.maryka ] | Ted Goddard [ ted.goddard ] |
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 1.3 Beta [ 10373 ] |
| Repository | Revision | Date | User | Message |
| ICEsoft Public SVN Repository | #33084 | Thu Jan 17 06:35:22 MST 2013 | philip.breau | Camera component does not catch IOExceptions when decoding image upload - guard against NPE in Utils.copyStream() |
| Files Changed | ||||
MODIFY
/icemobile/trunk/icemobile/core/src/main/java/org/icemobile/util/Utils.java
|

I was unable to reproduce the specific Exception above, but did see a similar Exception when attempting to upload no file after a successful file upload. This was due to application code initializing the file meta-information maps to empty, but clearing them to null. They are now cleared to empty maps.