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

Oliver Lietz commented on SLING-3114:
-------------------------------------

Fixed in r1591877 as described above (same behavior as in 
{{org.apache.sling.jcr.contentloader.internal.Loader}}).

Other issues are tracked in SLING-3533, SLING-3534 and SLING-3535.

> DefaultContentImporter should guard against a closed InputStream on system 
> view imports
> ---------------------------------------------------------------------------------------
>
>                 Key: SLING-3114
>                 URL: https://issues.apache.org/jira/browse/SLING-3114
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR ContentLoader 2.1.6
>            Reporter: Alex Parvulescu
>            Assignee: Oliver Lietz
>            Priority: Minor
>             Fix For: JCR ContentLoader 2.1.8
>
>
> For the special case of system view imports the null check [0] fails to take 
> into account the fact that the input stream is now closed (twice even [1], 
> [2]).
> This means that if something happened and the import did not go throught 
> (hence the _null_ node), the code will continue and fail later (line 99) with 
> a cryptic message: _java.io.IOException: Stream Closed_ [3]
> My proposal (no patch) is to add an else clause with a warn log and a return 
> statement.
> [0] 
> http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java?view=markup#l77
> [1] 
> http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java?view=markup#l201
> [2] 
> http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java?view=markup#l357
> [3]
> {noformat}
> Caused by: java.io.IOException: Stream Closed
>       at java.io.FileInputStream.available(Native Method)
>       at java.io.BufferedInputStream.available(BufferedInputStream.java:399)
>       at 
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parseInternal(XmlReader.java:205)
>       at 
> org.apache.sling.jcr.contentloader.internal.readers.XmlReader.parse(XmlReader.java:189)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to