获取java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory异常 [英] Getting java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory exception

查看:271
本文介绍了获取java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在执行spring& amp;的简单依赖注入程序。得到这个例外。
我已经包含了common-logging1.1.1.jar和spring.jar文件。你可以帮忙吗?

i am executing simple Dependency Injection program of spring & getting this exception. I have already included common-logging1.1.1.jar and spring.jar file. Could you please help to out?

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:119)
    at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:55)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:56)
    at com.client.StoryReader.main(StoryReader.java:15)
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)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 6 more


推荐答案

我也遇到了同样的问题,要修复,从下面的网址下载jar文件

I have also faced the same issues, to fix, download the jar files from the below url

http://commons.apache.org/logging/download_logging.cgi

并复制到你的lib文件夹,将解决你的问题。

and copy to your lib folder, will resolve your issue.

这篇关于获取java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆