码迷,mamicode.com
首页 > 编程语言 > 详细

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

时间:2016-06-08 21:46:40      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:

MyEclipse运行的时候报错,菜鸟不理解是什么意思,最后找了一些资料才知道是因为缺少commons-logging.jar包

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:66)
    at com.httputils.HttpUtil.methodPost(HttpUtil.java:26)
    at com.test.UrlTest.main(UrlTest.java:36)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 3 more

解决方案:把commons-logging.jar放到百度里面搜索一下,查询出来结果后,点击第一个Apache官网,下载相应的Jar包,解压,找到jar文件,然后放到你项目WEB-INF/lib里面就可以了

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

标签:

原文地址:http://www.cnblogs.com/2296bbs/p/5571276.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!