Shiro权限配置错误There is no filter with name 'anno' to apply to chain
来源:互联网 发布:demo软件 编辑:程序博客网 时间:2024/05/21 10:05
配置shiroFilter时出现如下错误:
十一月 07, 2017 7:29:34 下午 org.apache.catalina.core.StandardContext filterStart严重: Exception starting filter shiroFilterorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: There is no filter with name 'anno' to apply to chain [/preLogin] in the pool of available Filters. Ensure a filter with that name/path has first been registered with the addFilter method(s). at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:962) at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:324) at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235) at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:199) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1120) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1678) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)Caused by: java.lang.IllegalArgumentException: There is no filter with name 'anno' to apply to chain [/preLogin] in the pool of available Filters. Ensure a filter with that name/path has first been registered with the addFilter method(s).
shiroFilter配置如下:
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="securityManager" ref="securityManager" /> <property name="loginUrl" value="/preLogin" /> <property name="successUrl" value="main/index" /> <property name="unauthorizedUrl" value="/preLogin" /> <property name="filterChainDefinitions"> <value> /preLogin = anno /userregister = anno /registerpage = anno /static/** = anno /** = user </value> </property> </bean>
原因:无访问权限直接访问的配置不是“anno”而是“anon”。将上述配置改为
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="securityManager" ref="securityManager" /> <property name="loginUrl" value="/preLogin" /> <property name="successUrl" value="main/index" /> <property name="unauthorizedUrl" value="/preLogin" /> <property name="filterChainDefinitions"> <value> /preLogin = anon /userregister = anon /registerpage = anon /static/** = anon /** = user </value> </property> </bean>
就解决了。
阅读全文
0 0
- Shiro权限配置错误There is no filter with name 'anno' to apply to chain
- struts2配置错误 There is no Action mapped for namespace [/] and action name [] associated with context
- struts 配置出现错误 There is no Action mapped for namespace [/] and action name [findPage] associated with
- Struts2 错误:There is no result type defined for type 'json' mapped with name 'success'.
- 执行Shiro logout后,报如下错误: org.apache.shiro.session.UnknownSessionException: There is no session with id
- Shiro 不走鉴权方法并且,There is no session with id
- There is no royal road to science....
- There is no end to progress
- error:There is no SDK with the name or...
- [寒江孤叶丶的CrossApp之旅_03]CrossApp编译错误There is no SDK with the name or path
- [寒江孤叶丶的CrossApp之旅_03]CrossApp编译错误There is no SDK with the name or path
- There is no Action mapped for namespace [/] and action name [xxxxx] associated with context的错误原因
- The goal you specified requires a project to execute but there is no POM in 错误
- 使用screen恢复会话时出现There is no screen to be resumed matching错误解决办法
- java.lang.IllegalArgumentException: There is no shards to execute shard operation: 错误原因
- robotium的There is no XXX with index 错误
- There is no ~/.bashrc to setup user $PATH
- There is no item category assigned to account xxxxxxx
- 高精度板子
- .NET Framework 3.5 无法安装以下功能 安装错误:0x800F0906
- 图片压缩按比例压缩
- 成绩转换
- 链表相关的算法题大汇总 — 数据结构之链表奇思妙想
- Shiro权限配置错误There is no filter with name 'anno' to apply to chain
- Windows常用命令
- 模板整理:数论---线性筛素数,线性筛欧拉函数
- spark sql 入门操作
- JavaScript原型彻底理解2---继承中的原型链
- 以hdfs上文件或者本地文件作为输入在Pycharm中运行spark程序代码示例
- python 实现数据降维推荐系统(附Python源码)
- Jzoj5425 数论
- Java_String