• java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory


    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

  • 相关阅读:
    C语言中typedef可以出现在struct定义之前
    C语言编程规划——怎样用C语言设计一个程序
    如何去掉页眉页脚上的横线 如何去掉页眉上的横线 如何去掉页脚上的横线
    在Visual Studio 2005中使用WinPcap编写程序的配置方法
    使用WinPcap编程(1)——获取网络设备信息
    如何思考多维数组
    Visual Studio 2005编写C程序出错:error C2143,)前缺少*
    在Linux下运行peersim1.0.5
    Login failed for user 'IIS APPPOOL\DefaultAppPool'
    win2008 r2 安装sqlserver2005 sp3报错
  • 原文地址:https://www.cnblogs.com/denggelin/p/7219152.html
Copyright © 2020-2023  润新知