DCP java client

java

#1

getting following exception
Exception in thread “main” java.lang.NoClassDefFoundError: com/couchbase/client/core/lang/backport/java/util/Objects
at com.couchbase.client.dcp.Credentials.(Credentials.java:27)
at com.couchbase.client.dcp.StaticCredentialsProvider.(StaticCredentialsProvider.java:24)
at com.couchbase.client.dcp.Client$Builder.(Client.java:763)
at com.couchbase.client.dcp.Client.configure(Client.java:165)
at com.pru.DCPStream.main(DCPStream.java:22)
Caused by: java.lang.ClassNotFoundException: com.couchbase.client.core.lang.backport.java.util.Objects
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

during client configure
final Client client = Client.configure()
.hostnames(“localhost”)
.bucket(“SamplePrud”)
.username(“SamplePrud”)
.password(“prud123”)
.build();


#2

Hi @musa10593,

In the future, you may want to post Java related questions to the Java SDK forum: https://forums.couchbase.com/c/java-sdk

I’m tagging @david.nault and @daschl as a couple of people who might be able to help.


#3

getting following exception
Exception in thread “main” java.lang.NoClassDefFoundError: com/couchbase/client/core/lang/backport/java/util/Objects

Looks like a missing dependency, or a dependency conflict. What versions of com.couchbase.client:dcp-client and com.couchbase.client:core-io is your project using?

The dcp-client library has a transitive depenndecy on core-io, and normally it should select the correct version unless there’s a version override somewhere else in your dependency specification.