Resolution: Not a Problem
Affects Version/s: 1.2.0
Fix Version/s: None
Component/s: Integration: Spring
Environment:Linux, Spring, Java
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);