java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient


Samebug tips7

This error means there's a class missing in your classpath during runtime. You need to create a jar with all your dependencies and have it in your classpath. Check Maven Assembly Plugin and how to add your dependencies to a jar: https://goo.gl/U2zr8k


5 months ago
Expert tip

I had to build one fat jar that will include all dependencies from the other jars that i wanted to use.


3 months ago

Solutions on the web1191

Solution icon of github
org/apache/http/client/HttpClient

Solution icon of github
org/apache/http/client/HttpClient

Solution icon of stackoverflow
org/apache/http/client/methods/HttpUriRequest

Solution icon of stackoverflow
via Stack Overflow by shane
, 8 months ago
org/apache/http/client/methods/HttpUriRequest

Solution icon of stackoverflow
via Stack Overflow by Mudit
, 1 year ago
org/apache/commons/httpclient/methods/RequestEntity

Solution icon of stackoverflow
org/apache/spark/SparkConf

Solution icon of stackoverflow
via Stack Overflow by RIPI
, 6 months ago
org/apache/xmlrpc/AsyncCallback

Solution icon of github
via GitHub by divneet
, 2 months ago
org/apache/zookeeper/KeeperException

Solution icon of apache
org/apache/log4j/Logger

Stack trace

java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
	at java.lang.Class.getMethod0(Class.java:3018)
	at java.lang.Class.getMethod(Class.java:1784)
	at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.HttpClient
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 7 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 5 months ago
2 times, 6 months ago
Once, 9 months ago
2 times, 10 months ago
1579 more bugmates