I'm seeing an ArrayOutOfBounds exception in StreamingCharReader: java.lang.ArrayIndexOutOfBoundsException at org.apache.xerces.readers.StreamingCharReader.loadMoreChars (StreamingCharReader.java:1332) at org.apache.xerces.readers.StreamingCharReader.loadNextChar (StreamingCharReader.java:1260) at org.apache.xerces.readers.StreamingCharReader.scanQName (StreamingCharReader.java:725) at org.apache.xerces.framework.XMLDocumentScanner.scanElementType (XMLDocumentScanner.java:2075) at org.apache.xerces.framework.XMLDocumentScanner.access$100 (XMLDocumentScanner.java:86) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch (XMLDocumentScanner.java:1220) at org.apache.xerces.framework.XMLDocumentScanner.parseSome (XMLDocumentScanner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948) It appears that StreamingCharReader assumes that any chunk it gets from CharDataChunk.createChunk() will either not yet be allocated or will be a chunk that is CharDataChunk.CHUNK_SIZE in length (see slowLoadNextChar() and loadNextChar()). This however is not the case. In particular, we are using Xalan 1.2 for XSLT processing, and it appears that the XSLT processing allocates chunks (using CharDataChunk.setCharArray()) of variable sizes. The exception occurs after StreamingCharReader uses up its first chunk, requests another, and gets a previously used chunk of 123 characters.