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

解决方法:导入commons-logging.jar包

如果用的是maven直接用:


        commons-logging
        commons-logging
        1.2
即可

报错:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at org.apache.commons.beanutils.ConvertUtilsBean.(ConvertUtilsBean.java:154)
    at org.apache.commons.beanutils.BeanUtilsBean.(BeanUtilsBean.java:113)
    at org.apache.shiro.config.ReflectionBuilder.(ReflectionBuilder.java:126)
    at org.apache.shiro.config.ReflectionBuilder.(ReflectionBuilder.java:120)
    at org.apache.shiro.config.IniSecurityManagerFactory.(IniSecurityManagerFactory.java:64)
    at org.apache.shiro.config.IniSecurityManagerFactory.(IniSecurityManagerFactory.java:68)
    at org.apache.shiro.config.IniSecurityManagerFactory.(IniSecurityManagerFactory.java:73)
    at com.shiro.test.test.main(test.java:21)
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:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 8 more

你可能感兴趣的:(java,异常)