[
https://issues.apache.org/jira/browse/SHIRO-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239458#comment-13239458
]
Bryan Turner commented on SHIRO-352:
------------------------------------
Sorry, evidently it took me a bit longer to check my e-mail and write my
comment than it did for you to find a way around your problem! I'm glad you
were able to come up with an approach that works for you.
> 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