You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Matt Friedman (Closed) (JIRA)" <ji...@apache.org> on 2012/03/27 15:42:27 UTC

[jira] [Closed] (SHIRO-352) Shiro annotations with @Component and getBean(Type)

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

Matt Friedman closed SHIRO-352.
-------------------------------


Not a bug. 
                
> Shiro annotations with @Component and getBean(Type)
> ---------------------------------------------------
>
>                 Key: SHIRO-352
>                 URL: https://issues.apache.org/jira/browse/SHIRO-352
>             Project: Shiro
>          Issue Type: Bug
>          Components: Integration: Spring
>    Affects Versions: 1.2.0
>         Environment: Linux, Spring, Java
>            Reporter: Matt Friedman
>
> I have a bean where I'd like to annotate one of the methods with the @RequiresAuthentication annotation.
> When using the @RequiresAuthentication annotation and calling applicationContext.getBean(Class<?>) spring does not find my bean. Commenting out @RequiresAuthentication allows spring to find the bean. 
> Using the string name of the bean instead of the type (i.e. applicationContext.getBean(String)) does work. 
> // this causes spring to be unable to find the bean when using @RequiresAuthentication 
> Class<? extends Processor> processorType = command.getProcessorType();
> Processor processor = applicationContext.getBean(processorType);
> // However this works:
> Processor processor = applicationContext.getBean(processorStringName);

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