Reputation: 895
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
Reputation: 308021
You need the Apache Commons Logging library on your classpath.
Chances are that you're missing all the dependencies of PDFBox:
Upvotes: 35
Reputation: 111
Add commons-logging.jar file to your project classpath. that will fix the issue.
Upvotes: 10
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
Reputation: 3976
You need to ensure that the apache library is on your class path at runtime.
Upvotes: 1
Reputation: 61705
Is the commons logging jar on the classpath? You can download this from Download Commons Logging
Upvotes: 0