[ 
https://issues.apache.org/jira/browse/FELIX-3336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199767#comment-13199767
 ] 

J.W. Janssen edited comment on FELIX-3336 at 2/3/12 3:26 PM:
-------------------------------------------------------------

After some debugging, it appears that a ZipInputStream does *not* read all 
bytes from the underlying input stream, but stops after the last ZIP-entry 
(after this the central directory of the ZIP file is stored, which is not used 
by the implementation). Hence, the ExplodingOutputtingInputStream thinks it has 
read all underlying bytes, but in fact this is not the case. So, it terminates, 
while the other end still is processing the last couple of bytes (= central 
directory of ZIP-file). This explains why the above error occurs.

A solution would be to read the last couple of bytes in the input stream after 
the ZipInputStream is finished...

PS: one of the reasons why this might spuriously occur in real life is that the 
buffer size of PipedInputStream is large enough to read those last couple of 
bytes of the ZIP file...
                
      was (Author: jajans):
    After some debugging, it appears that a ZipInputStream does *not* read all 
bytes from the underlying input stream, but stops after the last ZIP-entry 
(after this the central directory of the ZIP file is stored, which is not used 
by the implementation). Hence, the ExplodingOutputtingInputStream thinks it has 
read all underlying bytes, but in fact this is not the case. So, it terminates, 
while the other end still is processing the last couple of bytes (= central 
directory of ZIP-file). This explains why the above error occurs.

A solution would be to read the last couple of bytes in the input stream after 
the ZipInputStream is finished...
                  
> Exceptions related to the pipe used in deployment admin
> -------------------------------------------------------
>
>                 Key: FELIX-3336
>                 URL: https://issues.apache.org/jira/browse/FELIX-3336
>             Project: Felix
>          Issue Type: Bug
>          Components: Deployment Admin
>            Reporter: Marcel Offermans
>
> Sporadically getting "Pipe closed" exceptions. Not reproducible yet, but 
> seemingly related to a line containing "input.close()" in the 
> ExplodingOutputtingInputStream. Needs investigation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to