MLS
MLS

Reputation: 895

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

I am using pdfbox in java to convert pdf to images. But when I compile I got the message

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory.

Here is the code I am following. Kindly help me to get out of this error.

Upvotes: 21

Views: 83689

Answers (5)

Joachim Sauer
Joachim Sauer

Reputation: 308021

You need the Apache Commons Logging library on your classpath.

Chances are that you're missing all the dependencies of PDFBox:

Minimum Requirement for PDFBox

  • Java 1.5
  • commons-logging

Upvotes: 35

Shiva Krish
Shiva Krish

Reputation: 111

Add commons-logging.jar file to your project classpath. that will fix the issue.

Upvotes: 10

behzad
behzad

Reputation: 984

I had the same problem and I have tried all of the solutions on the web, I had all of the required JAR files in my CLASSPATH ... but it didn't work. then I decided to move my JAR files from my DROPBOX folder to a normal folder and it worked!

So if your JARs are on dropbox or anything like that, move them to a normal folder and add them to your classpath! it will solve the java.lang.NoClassDefFoundError exception.

Upvotes: 0

Scorpion
Scorpion

Reputation: 3976

You need to ensure that the apache library is on your class path at runtime.

Upvotes: 1

Matthew Farwell
Matthew Farwell

Reputation: 61705

Is the commons logging jar on the classpath? You can download this from Download Commons Logging

Upvotes: 0

Related Questions