java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.commons.dbcp2.BasicDataSourceFactory.<clinit>(BasicDataSourceFactory.java:64)
at cn.itheima.jdbc.utils.DBCPUtils.<clinit>(DBCPUtils.java:22)
at cn.itheima.jdbc.test.TestDBCP.testUpdateUserById(TestDBCP.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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$000(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:459)
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(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 26 more

解决办法:

去下载Apache Commons Logging

右键项目->Properties->Java Build Path->Libraries->Add External JARs...->commons-logging-1.2.jar

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory的更多相关文章

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

    学习架构探险,从零开始写Java Web框架时,在学习到springAOP时遇到一个异常: "C:\Program Files\Java\jdk1.7.0_40\bin\java" ...

  2. java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory解决方案

    导入commons-logging-1.2.jar辅助类包即可. 报错提示: Exception in thread "main" java.lang.NoClassDefFoun ...

  3. IntellJ IDEA javax.servlet.ServletException 找不到javax.servlet.ServletException的类 java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    误状态:错误显示 解决: (1)说明缺少包---->添加如下包配置 <dependency> <groupId>javax.servlet.jsp</groupId ...

  4. MyEclipse8.5集成Tomcat7时的启动错误:Exception in thread “main” java.lang.NoClassDefFoundError org/apache/commons/logging/LogFactory

    今天,安装Tomcat7.0.21后,单独用D:\apache-tomcat-7.0.21\bin\startup.bat启动web服务正常.但在MyEclipse8.5中集成配置Tomcat7后,在 ...

  5. MyEclipse8.5集成Tomcat7时的启动错误:Exception in thread “main” java.lang.NoClassDefFoundError org/apache/commons/logging/LogFactory

    今天,安装Tomcat7.0.21后,单独用D:\apache-tomcat-7.0.21\bin\startup.bat启动web服务正常.但 在MyEclipse8.5中集成配置Tomcat7后, ...

  6. 【转】MyEclipse8.5集成Tomcat7时的启动错误:Exception in thread “main” java.lang.NoClassDefFoundError org/apache/commons/logging/LogFactory

    http://www.cnblogs.com/newsouls/p/4021198.html 今天,安装Tomcat7.0.21后,单独用D:\apache-tomcat-7.0.21\bin\sta ...

  7. shiro报错SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".和Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    未能加载类"org.slf4j.impl.StaticLoggerBinder" 解决方案: <dependency> <groupId>org.slf4j ...

  8. java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory 解决方案

    缺少 commons-logging.jar

  9. struts2与struts1整合,java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    原因:我往项目的WEB-INF/lib中导入了struts2基本的包,还有struts1的core包,以及struts2-strut1-plugin的包,但是没有导入commons-loggin-1. ...

随机推荐

  1. 15 Zabbix4.4.1系统告警“sda: Disk read/write request response are too high”

    点击返回:自学Zabbix之路 点击返回:自学Zabbix4.0之路 点击返回:自学zabbix集锦 Zabbix4.4.1系统告警“sda: Disk read/write request resp ...

  2. Linux查看所有子文件夹及文件的数量

    find命令查看(推荐): 所有子目录的数量: [root@localhost ~]# find afish -type d | wc -l158[root@localhost ~]# find af ...

  3. BZOJ1912 最长链树形DP

    每次求出最长链更新答案后要将最长链上的边权改为-1 写的贼长 还可以优化... /*Huyyt*/ #include<bits/stdc++.h> #define mem(a,b) mem ...

  4. qt5--数据类型转换

    QString-->Char*        str.toUtf8().data() pointf=QPointF(point);       //将QPoint转换为QPointF point ...

  5. Wpf自动滚动效果

    一.思路 1.使用ScrollView的Scroll.ScrollToVerticalOffset(offset)方法进行滚动 2.ScrollView中放置2个ListView,第一个滚动出边界后, ...

  6. MySQL--关于MySQL的那些练习题

    之前联系了一些MySQL的查询相关知识,现在补充作为一个记录,免得自己忘记. 致谢博主:https://blog.csdn.net/dehu_zhou/article/details/52881587 ...

  7. C++:关键字explicit的用法

    预测下面C++程序的输出: #include <iostream> using namespace std; class Complex { private: double real; d ...

  8. 51 Nod 1073 约瑟夫环

    1073 约瑟夫环  基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题  收藏  关注 N个人坐成一个圆环(编号为1 - N),从第1个人开始报数,数到K的人出列,后面的人 ...

  9. HGOI20190707 题解

    Problem A 钢铁侠的诞生 现在有$n$个数字$a_i \leq 10^9 $,然后取出$m$个数字,保证合法. 从小到大输出剩余的$n-m$个数字. 对于100%的数据$m\leq n \le ...

  10. jQuery_替换操作

    代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title ...