abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zixuan Zhang" <zhan...@gmail.com>
Subject Problem when getting atom feed/entry by abdera 0.4.0
Date Thu, 04 Dec 2008 08:33:46 GMT
Hi,
I met an "Attempted read on closed stream" exception when reading an atom
feed or entry by the following sample code
String entryUrl = ""; // the entry URL
ClientResponse response = abderaClient.get(entryUrl); //abderaClient is an
AbderaClient object that has access to the entry
Entry returnedEntry = (Entry) response.getDocument().getRoot();
response.release();

The detailed exception trace is attached below. There are also some
conditions to get the exception:
1. This is only occurs when the returned stream is long enough, for a very
short response there is no problem.
2. It doesn't occurs every time, but I am not sure when the exception will
occur.

Can anybody help on this issue? Thank you very much!

Caused by: org.apache.abdera.parser.ParseException:
com.ctc.wstx.exc.WstxIOException: Attempted read on closed stream.
Caused by: com.ctc.wstx.exc.WstxIOException: Attempted read on closed
stream.
at com.ctc.wstx.sr.StreamScanner.throwFromIOE(StreamScanner.java:683)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1086)
at
org.apache.abdera.parser.stax.FOMBuilder.getNextElementToParse(FOMBuilder.java:163)
at org.apache.abdera.parser.stax.FOMBuilder.next(FOMBuilder.java:187)
Caused by: java.io.IOException: Attempted read on closed stream.
at
org.apache.commons.httpclient.AutoCloseInputStream.isReadAllowed(AutoCloseInputStream.java:183)
at
org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:107)
at java.io.FilterInputStream.read(FilterInputStream.java:134)
at
org.apache.abdera.protocol.client.util.AutoReleasingInputStream.read(AutoReleasingInputStream.java:56)
at java.io.FilterInputStream.read(FilterInputStream.java:113)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:352)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:250)
at java.io.InputStreamReader.read(InputStreamReader.java:212)
at com.ctc.wstx.io.MergedReader.read(MergedReader.java:101)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:84)
at
com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at
com.ctc.wstx.sr.StreamScanner.loadMoreFromCurrent(StreamScanner.java:1021)
at com.ctc.wstx.sr.StreamScanner.parseLocalName2(StreamScanner.java:1771)
at com.ctc.wstx.sr.StreamScanner.parseLocalName(StreamScanner.java:1731)
at
com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2979)
at
com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2934)
at
com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2846)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)


-- 
Best Wishes.
Zi Xuan Zhang

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message