我正在使用
在Couchbase中创建一个生产视图HttpFuture<Boolean> asyncResult = client.asyncCreateDesignDoc(designDocProd);
Boolean success = asyncResult.get();
(从Design Doc的名称中省略“dev_”前缀会将其创建为生产视图而不是Dev View)
在检查成功确实等于true后,我尝试使用 couchbaseClient.query(查看,查询)访问视图,但后来我收到以下错误:
SERVER: unknown_error Reason: view_undefined
(如果需要,下面是完整堆栈跟踪)
如果我加一个5秒的睡眠,一切都运作良好......
有人遇到过这个问题吗?我错过了什么吗?
谢谢
的Eyal
完整堆栈跟踪:
Caused by: java.lang.RuntimeException: Failed to access the view
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:871)
.
.
Caused by: java.util.concurrent.ExecutionException: OperationException: SERVER: unknown_error Reason: view_undefined
at com.couchbase.client.internal.HttpFuture.waitForAndCheckOperation(HttpFuture.java:90)
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:74)
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:64)
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:864)
... 54 more
Caused by: OperationException: SERVER: unknown_error Reason: view_undefined
at com.couchbase.client.protocol.views.NoDocsOperationImpl.parseError(NoDocsOperationImpl.java:106)
at com.couchbase.client.protocol.views.ViewOperationImpl.handleResponse(ViewOperationImpl.java:68)
at com.couchbase.client.ViewNode$MyHttpRequestExecutionHandler.handleResponse(ViewNode.java:204)
at org.apache.http.nio.protocol.AsyncNHttpClientHandler.processResponse(AsyncNHttpClientHandler.java:417)
at org.apache.http.nio.protocol.AsyncNHttpClientHandler.inputReady(AsyncNHttpClientHandler.java:242)
at com.couchbase.client.http.AsyncConnectionManager$ManagedClientHandler.inputReady(AsyncConnectionManager.java:249)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:172)
at org.apache.http.impl.nio.DefaultClientIOEventDispatch.inputReady(DefaultClientIOEventDispatch.java:155)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:161)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:335)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:275)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
at java.lang.Thread.run(Thread.java:662)