You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Henry Zongaro (JIRA)" <xa...@xml.apache.org> on 2006/07/07 18:50:30 UTC

[jira] Commented: (XALANJ-2304) BaseMarkupSerializer.endDocument doesn't throw an SAXException when disk is full

    [ http://issues.apache.org/jira/browse/XALANJ-2304?page=comments#action_12419747 ] 

Henry Zongaro commented on XALANJ-2304:
---------------------------------------

I think this might be a Xerces-J issue.

> BaseMarkupSerializer.endDocument doesn't throw an SAXException when disk is full
> --------------------------------------------------------------------------------
>
>          Key: XALANJ-2304
>          URL: http://issues.apache.org/jira/browse/XALANJ-2304
>      Project: XalanJ2
>         Type: Bug

>     Versions: 2.7
>  Environment: Windows 2000
>     Reporter: Mark Arends

>
> When disk is full no exception was thrown when the endDocument method is called. This resulted in empty xml files being written.
> After the _printer.flush() the method _printer.getException should be called to determine if there was an exception. The following code should solve this I think:
>     /**
>      * Called at the end of the document to wrap it up.
>      * Will flush the output stream and throw an exception
>      * if any I/O error occured while serializing.
>      *
>      * @throws SAXException An I/O exception occured during
>      *  serializing
>      */
>     public void endDocument()
>         throws SAXException
>     {
>         try {
>         // Print all the elements accumulated outside of
>         // the root element.
>         serializePreRoot();
>         // Flush the output, this is necessary for fStrBuffered output.
>         _printer.flush();
>        // Find out if there was an exception
>         if ( _printer.getException() != null ){
>             throw _printer.getException();
> 	}
> 	
>         } catch ( IOException except ) {
>             throw new SAXException( except );
>     }
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org