Getting an InvocationException when using inline views in CouchDbRepositorySupport
bhaskarmurthy opened this issue · comments
Bhaskar Murthy commented
I'm using CoudhDbRepositorySupport
to create the data-access-object for a Couch document. The DAO looks like:
@TypeDiscriminator("doc.type && doc.type === 'Group'")
public class Group extends CouchDbDocument {
private static final long serialVersionUID = 1654968364806866221L;
public static final String ITEM_TYPE = "Group";
public Group() {
_type = ITEM_TYPE;
}
protected String _type;
public String getType() {
return _type;
}
public void setType(String type) {
_type = type;
}
The CouchDbRepository
object looks like:
public class GroupRepository extends CouchDbRepositorySupport<Group> {
public GroupRepository(CouchDbConnector db) {
super(Group.class, db, true);
initStandardDesignDocument();
}
}
However, when I try to use the getAll()
method provided by the repository, i end up with an InvocationException
:
03-08 12:50:53.876: E/TDDatabase(24484): Exception in TDRouter
03-08 12:50:53.876: E/TDDatabase(24484): java.lang.reflect.InvocationTargetException
03-08 12:50:53.876: E/TDDatabase(24484): at java.lang.reflect.Method.invokeNative(Native Method)
03-08 12:50:53.876: E/TDDatabase(24484): at java.lang.reflect.Method.invoke(Method.java:511)
03-08 12:50:53.876: E/TDDatabase(24484): at com.couchbase.touchdb.router.TDRouter.start(TDRouter.java:390)
03-08 12:50:53.876: E/TDDatabase(24484): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.executeRequest(TouchDBHttpClient.java:191)
03-08 12:50:53.876: E/TDDatabase(24484): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.get(TouchDBHttpClient.java:68)
03-08 12:50:53.876: E/TDDatabase(24484): at com.couchbase.touchdb.ektorp.TouchDBHttpClient.getUncached(TouchDBHttpClient.java:76)
03-08 12:50:53.876: E/TDDatabase(24484): at org.ektorp.http.RestTemplate.getUncached(RestTemplate.java:26)
03-08 12:50:53.876: E/TDDatabase(24484): at org.ektorp.impl.StdCouchDbConnector.executeQuery(StdCouchDbConnector.java:410)
03-08 12:50:53.876: E/TDDatabase(24484): at org.ektorp.impl.StdCouchDbConnector.queryView(StdCouchDbConnector.java:404)
03-08 12:50:53.876: E/TDDatabase(24484): at org.ektorp.support.CouchDbRepositorySupport.queryView(CouchDbRepositorySupport.java:230)
03-08 12:50:53.876: E/TDDatabase(24484): at org.ektorp.support.CouchDbRepositorySupport.getAll(CouchDbRepositorySupport.java:92)
Any ideas on what could cause this? Incorrect use, or no support in TDRouter for CoudhDbRepository from Ektorp?
Thanks,
Bhaskar
Chris Anderson commented
maybe upgrading ektorp will help? https://github.com/couchbase/couchbase-lite-android/issues/38