简体   繁体   English

java.lang.NoClassDefFoundError

[英]java.lang.NoClassDefFoundError

i am geting following error Am i missing some jar file? 我收到以下错误消息我缺少一些jar文件吗?

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
        at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:69)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:243)
        at org.smslib.helper.Logger.<init>(Logger.java:34)
        at org.smslib.Service.<init>(Service.java:93)
        at SendMessage.doIt(SendMessage.java:28)
        at SendMessage.main(SendMessage.java:82)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 6 more
Java Result: 1

Yes, you need the Apache Logging JAR file on your classpath. 是的,您需要在类路径上使用Apache Logging JAR文件。 Download it here: http://commons.apache.org/downloads/download_logging.cgi 在此处下载: http : //commons.apache.org/downloads/download_logging.cgi

Adding the jar files to ant lib will make them available for ant's java process and not your applications java process. 将jar文件添加到ant lib将使它们可用于ant的java进程而不是您的应用程序java进程。 Setting your application's classpath correctly must work. 必须正确设置应用程序的类路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM