shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Friedman (Resolved) (JIRA)" <>
Subject [jira] [Resolved] (SHIRO-352) Shiro annotations with @Component and getBean(Type)
Date Tue, 27 Mar 2012 13:42:26 GMT


Matt Friedman resolved SHIRO-352.

    Resolution: Not A Problem

Not a Shiro bug. I resolved the issue via Spring.
> Shiro annotations with @Component and getBean(Type)
> ---------------------------------------------------
>                 Key: SHIRO-352
>                 URL:
>             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
> 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:!default.jspa
For more information on JIRA, see:


View raw message