You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Maria Jurcovicova (JIRA)" <ji...@apache.org> on 2011/06/15 22:30:48 UTC

[jira] [Created] (SHIRO-306) EnvironmentLoaderListener crashes if custom filters are configured.

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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHIRO-306) EnvironmentLoaderListener crashes if custom filters are configured.

Posted by "Asaf Shakarchi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13175580#comment-13175580 ] 

Asaf Shakarchi commented on SHIRO-306:
--------------------------------------

Hey,
Can someone reply this issue? whether it's going to get fixed or whether there's a workaround?

Thanks.
                
> 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

        

[jira] [Resolved] (SHIRO-306) EnvironmentLoaderListener crashes if custom filters are configured.

Posted by "Les Hazlewood (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHIRO-306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Les Hazlewood resolved SHIRO-306.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.0

Fix applied to trunk.  IniFilterChainResolverFactoryTest and IniWebEnvironmentTest test cases verify fix.
                
> 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
>            Assignee: Les Hazlewood
>             Fix For: 1.2.0
>
>
> 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

        

[jira] [Commented] (SHIRO-306) EnvironmentLoaderListener crashes if custom filters are configured.

Posted by "Asaf Shakarchi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13175592#comment-13175592 ] 

Asaf Shakarchi commented on SHIRO-306:
--------------------------------------

After some debugging it seems like it's possible to add a [filters] section in the ini file,
Please document this here: http://shiro.apache.org/web.html whenever you can,


Thanks!
                
> 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

        

[jira] [Assigned] (SHIRO-306) EnvironmentLoaderListener crashes if custom filters are configured.

Posted by "Les Hazlewood (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHIRO-306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Les Hazlewood reassigned SHIRO-306:
-----------------------------------

    Assignee: Les Hazlewood
    
> 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
>            Assignee: Les Hazlewood
>
> 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

        

[jira] [Commented] (SHIRO-306) EnvironmentLoaderListener crashes if custom filters are configured.

Posted by "Les Hazlewood (Commented) (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] [Closed] (SHIRO-306) EnvironmentLoaderListener crashes if custom filters are configured.

Posted by "Les Hazlewood (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHIRO-306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Les Hazlewood closed SHIRO-306.
-------------------------------


Closing with the 1.2.0 release.
                
> 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
>            Assignee: Les Hazlewood
>             Fix For: 1.2.0
>
>
> 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