You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was attempting to page through _all_docs and on the first page I'm getting a stack trace:
Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT
at com.google.gson.Gson.fromJson(Gson.java:822)
at com.google.gson.Gson.fromJson(Gson.java:875)
at com.google.gson.Gson.fromJson(Gson.java:848)
at org.lightcouch.CouchDbUtil.JsonToObject(CouchDbUtil.java:74)
at org.lightcouch.View.queryView(View.java:196)
at org.lightcouch.View.queryNextPage(View.java:310)
at org.lightcouch.View.queryPage(View.java:266)
at uk.ac.ox.it.CouchUpdater.cleanup(CouchUpdater.java:106)
at uk.ac.ox.it.App.importSkills(App.java:50)
at uk.ac.ox.it.App.main(App.java:34)
Caused by: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT
at com.google.gson.internal.bind.JsonTreeReader.nextString(JsonTreeReader.java:154)
at com.google.gson.internal.bind.TypeAdapters$13.read(TypeAdapters.java:358)
at com.google.gson.internal.bind.TypeAdapters$13.read(TypeAdapters.java:346)
at com.google.gson.Gson.fromJson(Gson.java:810)
... 9 more
My code is effectively this:
View allDocs = couchClient.view("_all_docs");
String pageParam = null;
Page<Document> page;
do {
page = allDocs.queryPage(10, pageParam, Document.class);
// Do stuff
pageParam = page.getNextParam();
} while (page.isHasNext());
The text was updated successfully, but these errors were encountered:
buckett
added a commit
to buckett/LightCouch
that referenced
this issue
Jan 13, 2016
It looks like org.lightcouch.View#queryNextPage assumes that the value in a view will always be a String which isn't the case for _all_docs where you have something like:
I was attempting to page through _all_docs and on the first page I'm getting a stack trace:
My code is effectively this:
The text was updated successfully, but these errors were encountered: