I am trying to parse xml, but i am getting error while setInput method parser.setInput(responseStream, null);
responseStream value are getting fine.
error is like this,
08-28 15:47:37.069: WARN/System.err(5429): Invalid stream or encoding: java.io.IOException: Attempted read on closed stream. (position:START_DOCUMENT null@1:1) caused by: java.io.IOException: Attempted read on closed stream.; nested exception is:
08-28 15:47:37.107: WARN/System.err(5429): java.io.IOException: Attempted read on closed stream.
08-28 15:47:37.165: WARN/System.err(5429): at org.apache.http.conn.EofSensorInputStream.isReadAllowed(EofSensorInputStream.java:127)
08-28 15:47:37.165: WARN/System.err(5429): at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:138)
08-28 15:47:37.186: WARN/System.err(5429): at org.kxml2.io.KXmlParser.setInput(KXmlParser.java:1623)
08-28 15:47:37.196: WARN/System.err(5429): atin.project.parser.Getparser.parser(Getparser.java:31)
08-28 15:47:37.246: WARN/System.err(5429): atin.project.home.HomePgae$DataProvide.doInBackground(HomePgae.java:313)
08-28 15:47:37.279: WARN/System.err(5429): atin.project.home.HomePgae$DataProvide.doInBackground(HomePgae.java:1)
08-28 15:47:37.279: WARN/System.err(5429): at android.os.AsyncTask$2.call(AsyncTask.java:264)
08-28 15:47:37.286: WARN/System.err(5429): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-28 15:47:37.306: WARN/System.err(5429): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-28 15:47:37.306: WARN/System.err(5429): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-28 15:47:37.446: WARN/System.err(5429): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-28 15:47:37.516: WARN/System.err(5429): at java.lang.Thread.run(Thread.java:856)
thanks,
The error is telling you that the responseStream has already had .close() called on it. Have you used responseStream previously in your code or wrapped it with any other streams that have had .close() called on it?