shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Les Hazlewood (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SHIRO-306) EnvironmentLoaderListener crashes if custom filters are configured.
Date Mon, 26 Dec 2011 21:52:30 GMT

    [ https://issues.apache.org/jira/browse/SHIRO-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176026#comment-13176026
] 

Les Hazlewood commented on SHIRO-306:
-------------------------------------

Actually this is a bug.  The [filters] section has been deprecated and should not be necessary
anymore.  I'll take a peek at this as soon as I'm able.  Thanks for the issue!
                
> EnvironmentLoaderListener crashes if custom filters are configured. 
> --------------------------------------------------------------------
>
>                 Key: SHIRO-306
>                 URL: https://issues.apache.org/jira/browse/SHIRO-306
>             Project: Shiro
>          Issue Type: Bug
>          Components: Web
>         Environment: jetty
>            Reporter: Maria Jurcovicova
>
> Custom filters are initialized in init method of IniShiroFilter. EnvironmentLoaderListener
runs before filters and is unable to access custom filters. 
> How to reproduce it: define and use custom filter in Shiro.ini of samples-web application:
>     [main]
>     shiro.loginUrl = /login.jsp
>     # create custom filter
>     filter=org.apache.shiro.web.filter.authc.FormAuthenticationFilter
>     
>     ...
>     
>     [urls]
>     # Use custom filter defined above
>     /login.jsp = filter
>     /logout = logout
>     /account/** = filter
>     /remoting/** = filter, roles[b2bClient], perms["remote:invoke:lan,wan"]
>     /** = filter
> Exception thrown on application start-up:
> java.lang.IllegalArgumentException: There is no filter with name 'filter' to apply to
chain [/login.jsp] in the pool of available Filters.  Ensure a filter with that name/path
has first been registered with the addFilter method(s).
> 	at org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.addToChain(DefaultFilterChainManager.java:185)
> 	at org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.createChain(DefaultFilterChainManager.java:158)
> 	at org.apache.shiro.web.config.IniFilterChainResolverFactory.createChains(IniFilterChainResolverFactory.java:186)
> 	at org.apache.shiro.web.config.IniFilterChainResolverFactory.buildChains(IniFilterChainResolverFactory.java:127)
> 	at org.apache.shiro.web.config.IniFilterChainResolverFactory.createInstance(IniFilterChainResolverFactory.java:80)
> 	at org.apache.shiro.web.config.IniFilterChainResolverFactory.createInstance(IniFilterChainResolverFactory.java:1)
> 	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.createFilterChainResolver(IniWebEnvironment.java:187)
> 	at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:102)
> 	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:226)
> 	at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:138)
> 	at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)
> 	at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
> 	at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
> 	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
> 	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
> 	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
> 	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> 	at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
> 	at org.mortbay.jetty.Server.doStart(Server.java:224)
> 	at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> 	at org.apache.shiro.test.AbstractContainerTest.startContainer(AbstractContainerTest.java:47)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message