Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-16531

Zipfile creation fails if a zero byte file is in a folder being zipped

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.x
    • Fix Version/s: 2.8.0
    • Component/s: Content
    • Labels:
      None
    • Environment:
    • Test Plan:
      Hide

      Create a folder, create a text file inside it with no content which should result in a 0 byte file. Then attempt to create a zipfile from the newly created folder.

      Show
      Create a folder, create a text file inside it with no content which should result in a 0 byte file. Then attempt to create a zipfile from the newly created folder.

      Description

      If a file is in resources and is zero bytes when it is added to a zipfile (indirectly through a folder containing it being zipped) the creation of the zipfile fails with a NPE:

      @400000004a2fc2bb10bf4504 WARN: streamResourceBody(): non-positive content length: 0 id: /group/36e31e17-3384-4b2a-80a4-ce7c570a3421/lib/m2-target/library-M2/editor/HTMLArea/sakai_body.vm (2009-06-10 15:26:57,280 TP-Processor2_org.sakaiproject.content.impl.DbContentService)
      @400000004a2fc2bb10c0a87c java.lang.NullPointerException
      @400000004a2fc2bb10c582ac at org.apache.commons.io.IOUtils.copy(IOUtils.java:996)
      @400000004a2fc2bb10c5d4b4 at org.sakaiproject.content.impl.util.ZipContentUtil.storeContentResource(ZipContentUtil.java:201)
      @400000004a2fc2bb10c626bc at org.sakaiproject.content.impl.util.ZipContentUtil.storeContentCollection(ZipContentUtil.java:183)
      @400000004a2fc2bb10c674dc at org.sakaiproject.content.impl.util.ZipContentUtil.storeContentCollection(ZipContentUtil.java:179)
      @400000004a2fc2bb10c6c2fc at org.sakaiproject.content.impl.util.ZipContentUtil.storeContentCollection(ZipContentUtil.java:179)
      @400000004a2fc2bb10c7111c at org.sakaiproject.content.impl.util.ZipContentUtil.storeContentCollection(ZipContentUtil.java:179)
      @400000004a2fc2bb10c75f3c at org.sakaiproject.content.impl.util.ZipContentUtil.storeContentCollection(ZipContentUtil.java:179)
      @400000004a2fc2bb10c7ad5c at org.sakaiproject.content.impl.util.ZipContentUtil.compressFolder(ZipContentUtil.java:45)
      @400000004a2fc2bb10c7ff64 at org.sakaiproject.content.types.FolderType$FolderCompressAction.initializeAction(FolderType.java:1459)
      @400000004a2fc2bb10c84d84 at org.sakaiproject.content.tool.ResourcesAction.doDispatchAction(ResourcesAction.java:6138)
      @400000004a2fc2bb10c897bc at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      @400000004a2fc2bb10c8e5dc at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      @400000004a2fc2bb10c933fc at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      @400000004a2fc2bb10c9821c at java.lang.reflect.Method.invoke(Method.java:585)
      @400000004a2fc2bb10c9d03c at org.sakaiproject.cheftool.VelocityPortletPaneledAction.actionDispatch(VelocityPortletPaneledAction.java:593)
      @400000004a2fc2bb10ca2244 at org.sakaiproject.cheftool.VelocityPortletPaneledAction.processAction(VelocityPortletPaneledAction.java:509)
      @400000004a2fc2bb10cad20c at org.sakaiproject.cheftool.ToolServlet.doGet(ToolServlet.java:221)
      @400000004a2fc2bb10cad9dc at org.sakaiproject.cheftool.VelocityPortletPaneledAction.doGet(VelocityPortletPaneledAction.java:1007)
      @400000004a2fc2bb10caf534 at org.sakaiproject.cheftool.ToolServlet.doPost(ToolServlet.java:151)
      @400000004a2fc2bb10cb3b84 at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      @400000004a2fc2bb10cb89a4 at org.sakaiproject.vm.ComponentServlet.service(ComponentServlet.java:56)
      @400000004a2fc2bb10cbd7c4 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      @400000004a2fc2bb10cc25e4 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      @400000004a2fc2bb10cc7404 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      @400000004a2fc2bb10ccc224 at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:574)
      @400000004a2fc2bb10cd1044 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      @400000004a2fc2bb10cd5e64 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      @400000004a2fc2bb10cdac84 at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
      @400000004a2fc2bb10cdfaa4 at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461)
      @400000004a2fc2bb10ce48c4 at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:364)
      @400000004a2fc2bb10ce96e4 at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
      @400000004a2fc2bb10cee504 at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:459)
      @400000004a2fc2bb10cf3324 at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1224)
      @400000004a2fc2bb10cf8144 at org.sakaiproject.portal.charon.handlers.HierarchyToolHandler.doTool(HierarchyToolHandler.java:127)
      @400000004a2fc2bb10cfcf64 at org.sakaiproject.portal.charon.handlers.ToolHandler.doGet(ToolHandler.java:88)
      @400000004a2fc2bb10d01d84 at org.sakaiproject.portal.charon.handlers.ToolHandler.doPost(ToolHandler.java:65)
      @400000004a2fc2bb10d06ba4 at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1067)
      @400000004a2fc2bb10d0bdac at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      @400000004a2fc2bb10d107e4 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      @400000004a2fc2bb10d15604 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      @400000004a2fc2bb10d1a424 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      @400000004a2fc2bb10d1f244 at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:611)
      @400000004a2fc2bb10d24064 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      @400000004a2fc2bb10d28e84 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      @400000004a2fc2bb10d2dca4 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      @400000004a2fc2bb10d32ac4 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      @400000004a2fc2bb10d378e4 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      @400000004a2fc2bb10d3c31c at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      @400000004a2fc2bb10d4113c at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:548)
      @400000004a2fc2bb10d46344 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      @400000004a2fc2bb10d4ad7c at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      @400000004a2fc2bb10d4ff84 at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
      @400000004a2fc2bb10d5518c at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
      @400000004a2fc2bb10d5900c at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
      @400000004a2fc2bb10d5de2c at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
      @400000004a2fc2bb10d62864 at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
      @400000004a2fc2bb10d67684 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      @400000004a2fc2bb10d6c4a4 at java.lang.Thread.run(Thread.java:595)

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  Unassigned Unassigned
                  Reporter:
                  buckett Matthew Buckett
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration