Spring错误:java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
2015-05-14 16:56
906 查看
第一次搭建Spring框架,编写并运行例子时出现如下错误:
解决方法:缺少commons-logging.jar,下载jar包(如commons-logging-1.2.jar),添加到项目中。
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:164) at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:228) at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:89) 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.chapter1.TestSpring.main(TestSpring.java:11) Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 8 more
解决方法:缺少commons-logging.jar,下载jar包(如commons-logging-1.2.jar),添加到项目中。
相关文章推荐
- 处理错误: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- 【笔记】解决方法Caused by: java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- 【java web】Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- Caused by: java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- Caused by: java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- Caused by: java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory