解决方法:导入commons-logging.jar包
如果用的是maven直接用:
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>即可
报错:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:154)
at org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:113)
at org.apache.shiro.config.ReflectionBuilder.<init>(ReflectionBuilder.java:126)
at org.apache.shiro.config.ReflectionBuilder.<init>(ReflectionBuilder.java:120)
at org.apache.shiro.config.IniSecurityManagerFactory.<init>(IniSecurityManagerFactory.java:64)
at org.apache.shiro.config.IniSecurityManagerFactory.<init>(IniSecurityManagerFactory.java:68)
at org.apache.shiro.config.IniSecurityManagerFactory.<init>(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