为特定标签获取问题时出错



我正在使用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

问题是在API端,Stack-overflow-SDK内部使用API V1.0,从2014年5月12日起已关闭。

这导致无法通过SDK访问stackoverflow。

详情请浏览:https://stackapps.com/questions/3439/deprecating-api-v1-x

相关内容

  • 没有找到相关文章

最新更新