Home Ask Login Register

Developers Planet

Your answer is one click away!

Karlo Kraljic February 2016

CouchDB4j/ mvn dependencies are missing

I am having trouble setting up a connection to my local CouchDB programmatically.

I am using couchDb4j- and things seem to look good, until I run and try to connect to the DB.

My console is throwing the following error:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/http/params/HttpParams
Caused by: java.lang.ClassNotFoundException: org.apache.http.params.HttpParams

Since my small application is not finding a class, I've checked my dependencies- everything should be fine. I have:


Which should include all necessary http specific .jar (especially the first one should include the httpParams binaries; source: http://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore/4.0-beta3 ).

To prevent from including wrong binaries cached on my system, I am running the following:

mvn clean && mvn package

I've also deleted my .m2 folder.

Googling around gave me the hint that my classpath may be wrong leading to missing dependencies in runtime. But I have set up my classpath in my pom; see here:



sunny February 2016

Add these dependencies inside plugin declaration like this:


Plugins have their own classpath

Karlo Kraljic February 2016

Found the solution.

The problem were missing dependencies during execution.

To make sure, that all necessary files are binded during runtime, I had to include the following plugin:


which, if I got it right, binds on an "uber" jar all dependencies... Source: https://maven.apache.org/plugins/maven-shade-plugin/

Post Status

Asked in February 2016
Viewed 1,378 times
Voted 6
Answered 2 times


Leave an answer

Quote of the day: live life