chaimp
chaimp

Reputation: 17907

How to use java riak client without dependency issues

I am trying to use the Java Riak Client an existing project that I am working on. I am using riak-client-1.0.6-jar-with-dependencies.jar

I keep on getting errors like this one:

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonAutoDetect

And this one:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/impl/conn/PoolingClientConnectionManager

when I try to execute basic examples.

I would appreciate if somebody could point me to a straightforward way to include all of the necessary dependencies.

Thanks!

Upvotes: 2

Views: 395

Answers (1)

Brian Roach
Brian Roach

Reputation: 76918

The 1.0.6 Riak java client does not use Jackson 2.x which is what your first error is saying is missing or Apache's HTTP client 4.2.x which is what your second error says is missing. (You can determine that by the package structure in Jackson and the class in question in the Apache library).

Given that, it would seem your own code does and because you don't have those dependencies you're receiving those errors.

I would highly suggest using maven but in lieu of that you can download the jar-with-dependencies for the current version of the Riak client (1.1.0) which actually has had those packages upgraded to 2.1.2 and 4.2.2 respectively; it's available at: http://riak-java-client.s3.amazonaws.com/riak-client-1.1.0-jar-with-dependencies.jar

Upvotes: 4

Related Questions