Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

突然间爆出来的 gson 认为这是对象不是字符串版本1.5的 #80

Open
18736190608 opened this issue May 22, 2020 · 3 comments

Comments

@18736190608
Copy link

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
at com.google.gson.Gson.fromJson(Gson.java:927)
at com.google.gson.Gson.fromJson(Gson.java:892)
at com.google.gson.Gson.fromJson(Gson.java:841)
at com.google.gson.Gson.fromJson(Gson.java:813)
at com.boohee.plugin.translation.RequestRunnable.run(RequestRunnable.java:65)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
... 6 more

@kbja
Copy link

kbja commented May 27, 2020

你看下他的源码,他RequestRunnable的65行,明显是上面http请求返回了错误,不是200+,然后解析错误失败。猜测是有道api改了,或者到期了

@uniquezhangqi
Copy link

这个如何解决

@kbja
Copy link

kbja commented May 29, 2020

这个如何解决

就是个get请求,你去看下他拼url的方法,然后用postman试一下就完了。最近事儿太多,要不然我就自己改了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants