Java sdk 13.0.2
couchbase client: Java client 3.1.2
couchbase server 6.6
Hi, i have created a config file in springboot java class,:
@Configuration
public class DatabaseConfig {
@Bean
public Cluster createCluster() {
return Cluster.connect(host, username, password);
}
@Bean
public Bucket sessionBucket() {
Cluster cluster = createCluster();
List<QueryIndex> allIndexes = cluster.queryIndexes().getAllIndexes(sessionBucketName);
if (allIndexes == null || allIndexes.isEmpty()) {
new Thread(() -> cluster.queryIndexes().createPrimaryIndex(sessionBucketName)).start();
}
return cluster.bucket(sessionBucketName);
}
@Bean(name = "sessionCollection")
public Collection sessionCollection() {
return sessionBucket().defaultCollection();
}
}
pom.xml:
com.couchbase.client
java-client
3.1.2
in the maven dependecies i can see the couchbase client dependencies (core-io, reactor-core and reactive streams)
but we i start my application i get this exception:
Caused by: java.lang.NoClassDefFoundError: reactor/util/retry/Retry
at com.couchbase.client.core.config.DefaultConfigurationProvider.lambda$null$15(DefaultConfigurationProvider.java:360)
at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:151)
at reactor.core.publisher.FluxFlatMap.subscribeOrReturn(FluxFlatMap.java:92)
at reactor.core.publisher.Flux.subscribe(Flux.java:8129)
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)
at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:55)
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
at reactor.core.publisher.Mono.subscribe(Mono.java:4105)
at reactor.core.publisher.Mono.subscribeWith(Mono.java:4211)
at reactor.core.publisher.Mono.subscribe(Mono.java:4077)
at reactor.core.publisher.Mono.subscribe(Mono.java:4013)
at reactor.core.publisher.Mono.subscribe(Mono.java:3985)
at com.couchbase.client.core.Core.initGlobalConfig(Core.java:339)
at com.couchbase.client.java.AsyncCluster.(AsyncCluster.java:249)
at com.couchbase.client.java.Cluster.(Cluster.java:292)
at com.couchbase.client.java.Cluster.connect(Cluster.java:253)
at com.couchbase.client.java.Cluster.connect(Cluster.java:185)
at com.vodafone.id.device_initiated.config.DatabaseConfig.createCluster(DatabaseConfig.java:49)
at com.vodafone.id.device_initiated.config.DatabaseConfig$$EnhancerBySpringCGLIB$$d44c845e.CGLIB$createCluster$0()
at com.vodafone.id.device_initiated.config.DatabaseConfig$$EnhancerBySpringCGLIB$$d44c845e$$FastClassBySpringCGLIB$$2096b0df.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
at com.vodafone.id.device_initiated.config.DatabaseConfig$$EnhancerBySpringCGLIB$$d44c845e.createCluster()
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
… 124 common frames omitted
Caused by: java.lang.ClassNotFoundException: reactor.util.retry.Retry
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
… 153 common frames omitted
if i use the couchbase javaclient 3.0.5 i don’t have this exception, some one can help me for understand why i the this error?
Thanks