Spring data couchbase 3.0.9发行版-com.couchbase.client.java.error.ViewDoesNotExistException View person/all不存在

Spring data couchbase 3.0.9发行版-com.couchbase.client.java.error.ViewDoesNotExistException View person/all不存在,java,spring,spring-boot,couchbase,spring-data-couchbase,Java,Spring,Spring Boot,Couchbase,Spring Data Couchbase,我正在使用SpringBoot2.0.4和couchbase服务器(Enterprise5.5)作为本地机器上的docker容器。我有一个扩展了AbstractCouchbaseConfiguration的配置类,其中我提供了couchbase集群/bucket的详细信息 存储库界面用@N1qlPrimaryIndexed和@viewindex(designDoc=“person”,viewName=“all”)进行注释,并且我的application.properties文件具有spring.

我正在使用SpringBoot2.0.4和couchbase服务器(Enterprise5.5)作为本地机器上的docker容器。我有一个扩展了
AbstractCouchbaseConfiguration
的配置类,其中我提供了couchbase集群/bucket的详细信息

存储库界面用
@N1qlPrimaryIndexed
@viewindex(designDoc=“person”,viewName=“all”)
进行注释,并且我的application.properties文件具有
spring.data.couchbase.auto index=true

据我所知,SpringBoot应该能够自动创建主索引和视图

这是我的配置类

public class CouchbaseConfig extends AbstractCouchbaseConfiguration {
@Value("${couchbase_host}")
private String hostname;

@Value("${couchbase_bucket}")
private String bucket;

@Override
@Bean(name = BeanNames.COUCHBASE_CLUSTER_INFO)
public ClusterInfo couchbaseClusterInfo() throws Exception {
    return couchbaseCluster().authenticate("Administrator","password").clusterManager().info();
}
@Bean
public Cluster cluster() {
    return CouchbaseCluster.create(getEnvironment(),hostname);
}
@Override
@Bean(destroyMethod = "close", name = BeanNames.COUCHBASE_BUCKET)
public Bucket couchbaseClient() throws Exception {
    return couchbaseCluster().openBucket(getBucketName());
}

@Override
protected List<String> getBootstrapHosts() {
    return Collections.singletonList(hostname);
}

@Override
protected String getBucketName() {
    return bucket;
}

@Override
protected String getBucketPassword() {
    return "password";
}

@Override
protected CouchbaseEnvironment getEnvironment() {
    CouchbaseEnvironment environment = DefaultCouchbaseEnvironment.builder()
                                        .connectTimeout(25000)
                                        .queryTimeout(75000)
                                        .kvTimeout(5000)
                                        .socketConnectTimeout(40000)
                                        .build();
    return environment;
}

请帮助我理解为什么spring发现了两个couchbase环境,并且没有按照预期创建主索引和视图

在重新读取文档之后,我在
IndexManager
方法上添加了一个覆盖,在覆盖其他方法之后,spring正确地配置了环境

在重新读取文档之后,我在
IndexManager
方法上添加了一个覆盖,在覆盖其他方法之后,spring正确地配置了环境

2018-08-10 19:47:31.653  INFO 29198 --- [           main] i.InspectionsAggregateServiceApplication : No active profile set, falling back to default profiles: default
2018-08-10 19:47:31.697  INFO 29198 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@757acd7b: startup date [Fri Aug 10 19:47:31 CDT 2018]; root of context hierarchy
2018-08-10 19:47:32.283  INFO 29198 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'requestContextFilter' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration; factoryMethodName=requestContextFilter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.class]] with [Root bean: class [org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=requestContextFilter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2018-08-10 19:47:32.463  INFO 29198 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-08-10 19:47:32.836  INFO 29198 --- [           main] o.s.b.w.e.t.TomcatWebServer              : Tomcat initialized with port(s): 8080 (http)
2018-08-10 19:47:32.856  INFO 29198 --- [           main] o.a.c.c.StandardService                  : Starting service [Tomcat]
2018-08-10 19:47:32.856  INFO 29198 --- [           main] o.a.c.c.StandardEngine                   : Starting Servlet Engine: Apache Tomcat/8.5.32
2018-08-10 19:47:32.859  INFO 29198 --- [ost-startStop-1] o.a.c.c.AprLifecycleListener             : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/lakshmananraman/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-08-10 19:47:32.965  INFO 29198 --- [ost-startStop-1] o.a.c.c.C.[.[.[/]                        : Initializing Spring embedded WebApplicationContext
2018-08-10 19:47:32.966  INFO 29198 --- [ost-startStop-1] o.s.w.c.ContextLoader                    : Root WebApplicationContext: initialization completed in 1272 ms
2018-08-10 19:47:33.215  INFO 29198 --- [ost-startStop-1] o.s.b.w.s.ServletRegistrationBean        : Servlet com.ge.trans.rc360.inspection.config.JerseyConfig mapped to [/api/*]
2018-08-10 19:47:33.218  INFO 29198 --- [ost-startStop-1] o.s.b.w.s.ServletRegistrationBean        : Servlet dispatcherServlet mapped to [/]
2018-08-10 19:47:33.221  INFO 29198 --- [ost-startStop-1] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-08-10 19:47:33.221  INFO 29198 --- [ost-startStop-1] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-08-10 19:47:33.221  INFO 29198 --- [ost-startStop-1] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-08-10 19:47:33.221  INFO 29198 --- [ost-startStop-1] o.s.b.w.s.FilterRegistrationBean         : Mapping filter: 'requestContextFilter' to: [/*]
2018-08-10 19:47:33.444  INFO 29198 --- [           main] c.c.c.c.CouchbaseCore                    : CouchbaseEnvironment: {sslEnabled=false, sslKeystoreFile='null', sslTruststoreFile='null', sslKeystorePassword=false, sslTruststorePassword=false, sslKeystore=null, sslTruststore=null, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=8, computationPoolSize=8, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=12, queryServiceEndpoints=12, searchServiceEndpoints=12, configPollInterval=2500, configPollFloorInterval=50, ioPool=NioEventLoopGroup, kvIoPool=null, viewIoPool=null, searchIoPool=null, queryIoPool=null, coreScheduler=CoreScheduler, memcachedHashingStrategy=DefaultMemcachedHashingStrategy, eventBus=DefaultEventBus, packageNameAndVersion=couchbase-java-client/2.5.9 (git: 2.5.9, core: 1.5.9), retryStrategy=BestEffort, maxRequestLifetime=75000, retryDelay=ExponentialDelay{growBy 1.0 MICROSECONDS, powers of 2; lower=100, upper=100000}, reconnectDelay=ExponentialDelay{growBy 1.0 MILLISECONDS, powers of 2; lower=32, upper=4096}, observeIntervalDelay=ExponentialDelay{growBy 1.0 MICROSECONDS, powers of 2; lower=10, upper=100000}, keepAliveInterval=30000, continuousKeepAliveEnabled=true, keepAliveErrorThreshold=4, keepAliveTimeout=2500, autoreleaseAfter=2000, bufferPoolingEnabled=true, tcpNodelayEnabled=true, mutationTokensEnabled=false, socketConnectTimeout=40000, callbacksOnIoPool=false, disconnectTimeout=25000, requestBufferWaitStrategy=com.couchbase.client.core.env.DefaultCoreEnvironment$2@6b760460, certAuthEnabled=false, coreSendHook=null, forceSaslPlain=false, queryTimeout=75000, viewTimeout=75000, searchTimeout=75000, analyticsTimeout=75000, kvTimeout=5000, connectTimeout=25000, dnsSrvEnabled=false}
2018-08-10 19:47:33.701  INFO 29198 --- [      cb-io-1-1] c.c.c.c.n.Node                           : Connected to Node 127.0.0.1/localhost
2018-08-10 19:47:33.750  INFO 29198 --- [      cb-io-1-1] c.c.c.c.n.Node                           : Disconnected from Node 127.0.0.1/localhost
2018-08-10 19:47:34.146  INFO 29198 --- [      cb-io-1-2] c.c.c.c.n.Node                           : Connected to Node 127.0.0.1/localhost
2018-08-10 19:47:34.208  INFO 29198 --- [-computations-4] c.c.c.c.c.ConfigurationProvider          : Opened bucket person
2018-08-10 19:47:34.459  WARN 29198 --- [           main] c.c.c.c.e.CoreEnvironment                : More than 1 Couchbase Environments found (2), this can have severe impact on performance and stability. Reuse environments!
2018-08-10 19:47:34.460  INFO 29198 --- [           main] c.c.c.c.CouchbaseCore                    : CouchbaseEnvironment: {sslEnabled=false, sslKeystoreFile='null', sslTruststoreFile='null', sslKeystorePassword=false, sslTruststorePassword=false, sslKeystore=null, sslTruststore=null, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=8, computationPoolSize=8, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=12, queryServiceEndpoints=12, searchServiceEndpoints=12, configPollInterval=2500, configPollFloorInterval=50, ioPool=NioEventLoopGroup, kvIoPool=null, viewIoPool=null, searchIoPool=null, queryIoPool=null, coreScheduler=CoreScheduler, memcachedHashingStrategy=DefaultMemcachedHashingStrategy, eventBus=DefaultEventBus, packageNameAndVersion=couchbase-java-client/2.5.9 (git: 2.5.9, core: 1.5.9), retryStrategy=BestEffort, maxRequestLifetime=75000, retryDelay=ExponentialDelay{growBy 1.0 MICROSECONDS, powers of 2; lower=100, upper=100000}, reconnectDelay=ExponentialDelay{growBy 1.0 MILLISECONDS, powers of 2; lower=32, upper=4096}, observeIntervalDelay=ExponentialDelay{growBy 1.0 MICROSECONDS, powers of 2; lower=10, upper=100000}, keepAliveInterval=30000, continuousKeepAliveEnabled=true, keepAliveErrorThreshold=4, keepAliveTimeout=2500, autoreleaseAfter=2000, bufferPoolingEnabled=true, tcpNodelayEnabled=true, mutationTokensEnabled=false, socketConnectTimeout=40000, callbacksOnIoPool=false, disconnectTimeout=25000, requestBufferWaitStrategy=com.couchbase.client.core.env.DefaultCoreEnvironment$2@1a87b51, certAuthEnabled=false, coreSendHook=null, forceSaslPlain=false, queryTimeout=75000, viewTimeout=75000, searchTimeout=75000, analyticsTimeout=75000, kvTimeout=5000, connectTimeout=25000, dnsSrvEnabled=false}
2018-08-10 19:47:34.569  INFO 29198 --- [           main] o.s.w.s.h.SimpleUrlHandlerMapping        : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-10 19:47:34.681  INFO 29198 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@757acd7b: startup date [Fri Aug 10 19:47:31 CDT 2018]; root of context hierarchy
2018-08-10 19:47:34.734  INFO 29198 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-08-10 19:47:34.735  INFO 29198 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-08-10 19:47:34.754  INFO 29198 --- [           main] o.s.w.s.h.SimpleUrlHandlerMapping        : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-10 19:47:34.755  INFO 29198 --- [           main] o.s.w.s.h.SimpleUrlHandlerMapping        : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-08-10 19:47:34.922  INFO 29198 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-08-10 19:47:34.955  INFO 29198 --- [           main] o.s.b.w.e.t.TomcatWebServer              : Tomcat started on port(s): 8080 (http) with context path ''
Caused by: 
org.springframework.dao.InvalidDataAccessResourceUsageException: View 
person/all does not exist.; nested exception is 
com.couchbase.client.java.error.ViewDoesNotExistException: View 
person/all does not exist.
Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.java.document.json.JsonObject.class
2018-08-10 19:47:35.115  INFO 29198 --- [           main] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@757acd7b: startup date [Fri Aug 10 19:47:31 CDT 2018]; root of context hierarchy
2018-08-10 19:47:35.116  INFO 29198 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2018-08-10 19:47:35.123  INFO 29198 --- [           main] c.c.c.c.c.ConfigurationProvider          : Closed bucket person
2018-08-10 19:47:35.123  INFO 29198 --- [      cb-io-1-2] c.c.c.c.n.Node                           : Disconnected from Node 127.0.0.1/localhost