- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 Spring boot 2.0.4 和 couchbase 服务器(企业 5.5)作为本地计算机上的 docker 容器。我有一个扩展 AbstractCouchbaseConfiguration
的配置类,我在其中提供了 couchbase 集群/存储桶详细信息。
存储库接口(interface)用 @N1qlPrimaryIndexed
和 @ViewIndexed(designDoc = "person", viewName = "all")
注释,我的 application.properties 文件有 spring.data.couchbase.auto-index=true
据我了解,Spring boot 应该能够自动创建主索引和 View 。
这是我的配置类
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;
}
当我根据上述配置启动我的应用程序时,
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 ''
我注意到它连接和断开到节点并显示警告,发现了多个 couchbase 环境。虽然存储桶是打开的,但 spring 不会创建 View 和索引,并且我的应用程序失败。
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
请帮助我理解为什么 spring 找到两个 couchbase 环境并且没有按预期创建主索引和 View 。
最佳答案
再次重新阅读文档后,我添加了对 IndexManager 方法的重写,并在重写其他方法后,spring 正确配置了环境。
关于java - Spring data couchbase 3.0.9 发布 - com.couchbase.client.java.error.ViewDoesNotExistException 查看人员/全部不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51795769/
是否有用于手动测试的代码覆盖工具?比如我新写了30行代码,编译,然后运行,有什么办法可以快速验证这30行都运行了吗? 另外,后来,在我将代码 checkin 正式版本后,有什么方法可以验证测试部门在进
老实说,这是一个家庭作业问题,但我已经浪费了好几个小时,而且无法正确解决。它返回错误数量的结果或错误的数据: 我需要选择参与指导电影和/或在电影中表演的每个人以及他们所做的次数,如果至少 5 次。 有
我正在尝试测试 MacOS 的应用内购买。输入测试用户凭据后,App Store 提示:“当前收据无效或 ds 人员 ID 不匹配。”并且购买失败。 最佳答案 我尝试了很多方法来解决这个问题。 Get
我正在为 Jenkins 使用 ActiveDirectory 插件,因此用户必须使用他们的凭据登录到 Jenkins。然后用户在 Jenkins 中被称为 joe.doe,这很完美。 当同一个人 c
如何从 Infopath 人员/组选取器检索电子邮件地址?当我将人员/组选取器添加到 infopath 表单时,我只得到 3 个字段 DisplayName、AccountId、AccountType
在 Snow Leopard 中,可以在 iCal 事件中显示空闲/忙碌时间。我搜索了 CalStore.framework 的 header ,但找不到任何描述该字段的属性。如何检索日历事件的忙/闲
是否有人成功地从专门针对 SharePoint 2013 的新建或编辑表单中获取用户(个人或组)字段的值? 我已经尝试了通过搜索互联网找到的所有解决方案以及我自己能想到的所有解决方案,所有结果都为空白
所以我需要将一个 Twitter 帐户添加到 ABRecordRef 中。然而,最快的方法似乎是获取社交资料属性的多值引用,创建它的可变版本,查找它是否有 Twitter 条目,如果已经有,则创建
我正在尝试将使用 Tomcat(最初是 5.5,但可以与 7 一起使用)在 MyEclipse 中开发的应用程序部署到我们的演示服务器 (Sun Java Web Server 7)。不幸的是,所有设
我是一名优秀的程序员,十分优秀!