0

i am geting following error Am i missing some jar file?

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 

2 Answers 2

8

Yes, you need the Apache Logging JAR file on your classpath. Download it here: http://commons.apache.org/downloads/download_logging.cgi

Sign up to request clarification or add additional context in comments.

6 Comments

I have added the jar files folund in lib foder fond after downloading apache loging C:\Downloads\apache-ant-1.7.1-bin\apache-ant-1.7.1\lib But i am still geting same error
Can you tell us how you are trying to invoke the application that is throwing this exception? And you say you took the JAR files found in the download but where did you put them?
i am using netbeans 6.7 ide.I added the jar by right clicking the project > add libs >add jars
Earlier, your comment contained "C:\Downloads\apache-ant-1.7.1-bin\apache-ant-1.7.1\lib", what does your problem have to do with ant? Did you mistakenly download ant and not the apache logging JAR? apache.mirror.facebook.net/commons/logging/binaries/…
thanks for replying.but i am still geting same error. i added jar files found in this folder C:\Downloads\commons-logging-1.1.1-bin\commons-logging-1.1.1
|
1

Adding the jar files to ant lib will make them available for ant's java process and not your applications java process. Setting your application's classpath correctly must work.

3 Comments

i am new to java.Can u explain in detail.I am usinging netbeans 6.7 ide
Right click on your project -> click Properties -> from right hand side select Libraries -> In the Compile tab on the right hand side click Add Jar/Folder -> Browse to your jar files and click Open -> then click Ok to come out of the properties. This should work fine.
this is for netbeans 6.5 .. i think this should work for 6.7 as well

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.