我正在使用 stackoverflow-java-sdk 来获取特定标记的最新问题。
但是我得到了以下错误。我不知道它有什么问题,早期相同的代码库正在运行。
Exception in thread "Thu May 15 21:14:45 IST 2014" com.google.code.stackexchange.client.exception.StackExchangeApiException: com.google.code.stackexchange.client.exception.StackExchangeApiException: com.google.gson.JsonIOException: java.io.IOException: Stream closed
at com.google.code.stackexchange.client.query.impl.BaseStackOverflowApiQuery.list(BaseStackOverflowApiQuery.java:151)
at com.google.code.stackexchange.client.query.impl.QuestionApiQueryImpl.list(QuestionApiQueryImpl.java:188)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.google.code.stackexchange.client.exception.StackExchangeApiException: com.google.gson.JsonIOException: java.io.IOException: Stream closed
at com.google.code.stackexchange.client.query.impl.BaseStackOverflowApiQuery.unmarshallObject(BaseStackOverflowApiQuery.java:208)
at com.google.code.stackexchange.client.impl.StackExchangeApiGateway.callApiMethod(StackExchangeApiGateway.java:266)
at com.google.code.stackexchange.client.impl.StackExchangeApiGateway.callApiMethod(StackExchangeApiGateway.java:233)
at com.google.code.stackexchange.client.query.impl.BaseStackOverflowApiQuery.list(BaseStackOverflowApiQuery.java:142)
... 14 more
Caused by: com.google.gson.JsonIOException: java.io.IOException: Stream closed
at com.google.gson.internal.Streams.parse(Streams.java:58)
at com.google.gson.JsonParser.parse(JsonParser.java:84)
at com.google.gson.JsonParser.parse(JsonParser.java:59)
at com.google.code.stackexchange.client.query.impl.BaseStackOverflowApiQuery.unmarshallObject(BaseStackOverflowApiQuery.java:201)
... 17 more
Caused by: java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:151)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at com.google.gson.stream.JsonReader.fillBuffer(JsonReader.java:1263)
at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1309)
at com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1514)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:523)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:414)
at com.google.gson.internal.Streams.parse(Streams.java:42)
... 20 more
答案 0 :(得分:0)
问题是在API端,Stack-overflow-SDK在内部使用API V1.0,已于2014年5月12日关闭。
这导致无法通过SDK访问stackoverflow。
请在以下位置找到更多详情: https://stackapps.com/questions/3439/deprecating-api-v1-x