Trying to inject bean in a class which has field with @Any annotation. But getting error as -
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.enterprise.inject.Instance' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject(), @javax.enterprise.inject.Any()}
@Named
@Singleton
public class ProcessorFactoryImpl implements ProcessorFactory {
@Inject @Any
private Instance<Processor> processorList;
}
Interface is
public interface Processor {
some method
}
And implementing class is :
@Named
@Singleton
@Default
public class ProcessorImpl implements Processor {
}
For now, I have only one implementation so did not create qualifiers.