0

I have this bizarre problem. My application was running perfectly so many times I executed it, but suddenly yesterday it started throwing this exception

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.methods.HttpUriRequest
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 3 more

Many say that the problem might be some compatibility issues between the java version of the compile machine (under Eclipse i am using Java-8-Oracle J2SE-1.5) and the execution machine, in this case a VM using

>$java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

This looks ok to me.

EDIT:
Solved!
It turned out that the problem had nothing to do with the apache-httpclient.jar. The problem was that my root directory was getting low on free space. When i tried to re run this, instead of the previous error I got Insufficient space for shared memory file so by deleting /temp things got working.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Skaros Ilias
  • 1,008
  • 12
  • 40

1 Answers1

0

You miss the apache-httpclient.jar in your classpath. Download and add it.

Jens
  • 67,715
  • 15
  • 98
  • 113