我尝试在 android 中使用 ektorp 客户端进行复制,但出现错误:org.ektorp.DocumentNotFoundException:在 db 路径上找不到任何内容:/_replicate,响应正文:{“error”:“not_found”,“reason”:“未知 URL "}
我安装了网关和 CouchBase 服务器。我访问了 url /sync_gateway,但客户端尝试访问 /sync_gateway/_replicate。这是什么 ???我必须做些什么才能让它发挥作用????
提前谢谢你最好的问候
我的代码:
// start Ektorp adapter
HttpClient httpClient = new AndroidHttpClient.Builder()
.host("XXX")
.username("XXX")
.password("XXX")
.port(4984)
.build();
CouchDbInstance dbInstance = new StdCouchDbInstance(httpClient);
// create a local database
CouchDbConnector dbConnector = new StdCouchDbConnector("sync_gateway", dbInstance);
// pull this database to the test replication server
ReplicationCommand pullCommand = new ReplicationCommand.Builder()
.source("sync_gateway")
.target("XXX")
.continuous(true)
.build();
ReplicationStatus status = dbInstance.replicate(pullCommand);