Error: Java.lang.NoClassDefFoundError

Source: Internet
Author: User

While practicing spring, there was an error running the program: Java.lang.NoClassDefFoundError

java.lang.noclassdeffounderror:org/apache/commons/logging/logfactory at Org.springframework.context.support.AbstractApplicationContext.<init> (abstractapplicationcontext.java:161) at Org.springframework.context.support.AbstractApplicationContext.<init> (abstractapplicationcontext.java:225) at Org.springframework.context.support.AbstractRefreshableApplicationContext.<init> (abstractrefreshableapplicationcontext.java:88) at Org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init> (abstractrefreshableconfigapplicationcontext.java:58) at Org.springframework.context.support.AbstractXmlApplicationContext.<init> (abstractxmlapplicationcontext.java:61) at Org.springframework.context.support.ClassPathXmlApplicationContext.<init> (classpathxmlapplicationcontext.java:136) at Org.springframework.context.support.ClassPathXmlApplicationContext.<init> (classpathxmlapplicationcontext.java:83) at Com.spring.bao1.TestBeanPostProcessor.testBeanPostProcessor (Testbeanpostprocessor.java:11) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (Nativemethodaccessorimpl.java:62) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (Method.java:498) at org.junit.runners.model.frameworkmethod$1.runReflectiveCall (frameworkmethod.java:50) at Org.junit.internal.runners.model.ReflectiveCallable.run (Reflectivecallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively (Frameworkmethod.java:47) at Org.junit.internal.runners.statements.InvokeMethod.evaluate (Invokemethod.java:17) at Org.junit.runners.ParentRunner.runLeaf (Parentrunner.java:325) at Org.junit.runners.BlockJUnit4ClassRunner.runChild (Blockjunit4classrunner.java:78) at Org.junit.runners.BlockJUnit4ClassRunner.runChild (Blockjunit4classrunner.java:57) at org.junit.runners.parentrunner$3.run (parentrunner.java:290) at org.junit.runners.parentrunner$1.schedule (parentrunner.java:71) at Org.junit.runners.ParentRunner.runChildren (Parentrunner.java:288) at org.junit.runners.parentrunner.access$(parentrunner.java:58) at org.junit.runners.parentrunner$2.evaluate (parentrunner.java:268) at Org.junit.runners.ParentRunner.run (Parentrunner.java:363) at Org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (Junit4testreference.java:86) at Org.eclipse.jdt.internal.junit.runner.TestExecution.run (Testexecution.java:38) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (Remotetestrunner.java:55X) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (Remotetestrunner.java:678) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (Remotetestrunner.java:382) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (Remotetestrunner.java:192) 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)    ... More

The reason for this error is that a jar package is missing: Commons-logging.jar, this jar is one of Spring's essential packages, so it will get an error if it lacks it.

Error: Java.lang.NoClassDefFoundError

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.