NutzCN Logo
问答 用shiro做登录的问题。
发布于 2863天前 作者 1037424761 1836 次浏览 复制 上一个帖子 下一个帖子
标签:

小白按照新手入门做到用shiro做登录。

java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
	at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:120)
	at org.apache.commons.beanutils.converters.AbstractConverter.setDefaultValue(AbstractConverter.java:336)
	at org.apache.commons.beanutils.converters.BooleanConverter.<init>(BooleanConverter.java:86)
	at org.apache.commons.beanutils.ConvertUtilsBean.registerPrimitives(ConvertUtilsBean.java:627)
	at org.apache.commons.beanutils.ConvertUtilsBean.deregister(ConvertUtilsBean.java:578)
	at org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:164)
	at org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:117)
	at org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:68)
	at org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:153)
	at org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:80)
	at org.apache.commons.beanutils.PropertyUtilsBean.getInstance(PropertyUtilsBean.java:114)
	at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:460)
	at org.apache.shiro.config.ReflectionBuilder.isTypedProperty(ReflectionBuilder.java:409)
	at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:702)
	at org.apache.shiro.config.ReflectionBuilder.applySingleProperty(ReflectionBuilder.java:364)
	at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:325)
	at org.apache.shiro.config.ReflectionBuilder$AssignmentStatement.doExecute(ReflectionBuilder.java:955)
	at org.apache.shiro.config.ReflectionBuilder$Statement.execute(ReflectionBuilder.java:887)
	at org.apache.shiro.config.ReflectionBuilder$BeanConfigurationProcessor.execute(ReflectionBuilder.java:765)
	at org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:260)
	at org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:167)
	at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:130)
	at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:108)
	at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:94)
	at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:46)
	at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
	at org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
	at org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203)
	at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99)
	at org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92)
	at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)
	at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)
	at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:221)
	at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:133)
	at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5077)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5591)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

slf4j-api和slf4j-log版本分别是1.7.12和12-1.7.12也试了其他版本都没解决,有大牛帮忙看看吗?

6 回复

是maven还是普通javaee项目,感觉是有其他版本的slf4j存在

还没有用maven,就是javaee的项目

按ctrl+shift+T,输入LocationAwareLogger,看看出现多少个,分别属于什么jar

有2个,一个是我自己按文档搭的,是1.7.12.
还有个在maven库里,是下载的完整的项目里maven下载的是1.7.21。
是2个项目,存在在冲突吗?

我感觉还有。。。 我记得是1.6.x的slf4j才没有这个方法

添加回复
请先登陆
回到顶部