因此,我正在尝试使用 contains 检查我的数据库中是否存在设计文档。
if (!dbClient.contains("_design/myDesignDoc")) {
//Do stuff
}
但是我得到一个 java.lang.IllegalArgumentException: Entity may not be null 错误,因为 id 中有 _design 的下划线。
java.lang.IllegalArgumentException: Entity may not be null
at org.apache.http.util.Args.notNull(Args.java:54) ~[httpcore-4.4.11.jar:4.4.11]
at org.apache.http.util.EntityUtils.toString(EntityUtils.java:307) ~[httpcore-4.4.11.jar:4.4.11]
at org.lightcouch.CouchDbClientBase.validate(CouchDbClientBase.java:659) ~[lightcouch-0.2.0.jar:na]
at org.lightcouch.CouchDbClient$3.process(CouchDbClient.java:223) ~[lightcouch-0.2.0.jar:na]
at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:142) ~[httpcore-4.4.11.jar:4.4.11]
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:191) ~[httpclient-4.5.9.jar:4.5.9]
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.9.jar:4.5.9]
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.9.jar:4.5.9]
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.9.jar:4.5.9]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72) ~[httpclient-4.5.9.jar:4.5.9]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.9.jar:4.5.9]
at org.lightcouch.CouchDbClientBase.executeRequest(CouchDbClientBase.java:480) ~[lightcouch-0.2.0.jar:na]
at org.lightcouch.CouchDbClientBase.head(CouchDbClientBase.java:566) ~[lightcouch-0.2.0.jar:na]
我曾经能够做到这一点,但我根本不记得我做了什么。如何查看设计文档是否存在?
森林海
慕丝7291255
相关分类