You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Brian Demers (JIRA)" <ji...@apache.org> on 2016/07/15 15:07:20 UTC

[jira] [Closed] (SHIRO-413) init() method is not called on class that implements org.apache.shiro.util.Initializable

     [ https://issues.apache.org/jira/browse/SHIRO-413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Demers closed SHIRO-413.
------------------------------
    Resolution: Fixed

> init() method is not called on class that implements org.apache.shiro.util.Initializable
> ----------------------------------------------------------------------------------------
>
>                 Key: SHIRO-413
>                 URL: https://issues.apache.org/jira/browse/SHIRO-413
>             Project: Shiro
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 1.2.1
>            Reporter: Dan Rollo
>            Priority: Critical
>             Fix For: 1.2.2
>
>
> Classes configured in shiro.ini that implement the "Initializable" interface should automatically have their "init()" methods called. It appears this call is not always occurring. Example below:
> public class WaffleNegotiateAuthFilter extends BasicHttpAuthenticationFilter
>                                        implements Initializable
> {
> ...
>     private final NegotiateSecurityFilter negotiateFilter;
>     public WaffleNegotiateAuthFilter() {
>         negotiateFilter = new NegotiateSecurityFilter();
>     }
>     @Override
>     protected void onFilterConfigSet() throws Exception {
>         negotiateFilter.init(getFilterConfig());
>     }
>     /**
>      * Initializes this object.
>      *
>      * @throws org.apache.shiro.ShiroException
>      *          if an exception occurs during initialization.
>      */
>     public void init() throws ShiroException {
>         try {
>             super.init(getFilterConfig());
>         } catch (ServletException e) {
>             throw new ShiroException(e);
>         }
>     }
> ...
> I still do not see the init() method being called.
> See this thread for more details: http://shiro-user.582556.n2.nabble.com/AuthenticatingFilter-lifecycle-when-used-in-urls-td7578146.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)