袁艺

个人站

欢迎来到我的个人站~


java.lang.NoClassDefFoundError:org/apache/commons/logging/LogFactory

在搭建SSH项目时出现了这样的错误:

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-xx.jar”包,只需在网上搜索下载commons-logging-1.2.jar,之后再导入你的java工程中即可!