Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory
at org.apache.pdfbox.pdmodel.PDDocument.<clinit>(PDDocument.java:95)
at 读取PDF.getMessage_pdf.ParsePdf(getMessage_pdf.java:34)
at 读取PDF.getMessage_pdf.main(getMessage_pdf.java:28)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
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)
... 3 more
出现此错误的原因为——缺少“commons-logging-1.2.jar”包,只需在网上搜索下载commons-logging-1.2.jar,之后再导入你的java工程中即可!