NoUniqueBeanDefinitionException: No qualifying bean of type in spring, need of @Qualifier

The story will tell about the scenario of the application failed to start due to an exception org. spring framework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type.

I will explain the one scenario that happens. As described in the image we have class One that implements interface A and class Two extend class B and interface B.

I have one action, facade, or handler component class where I need to invoke for service for two different purposes.

As per HandlerClass uses the @Autowired
private InterfaceA interfaceA;

private Interfaceb interfaceB.

Here we will get the compile-time error like Could not autowire there is more than bean.


You have two classes marked as being Spring autowired components.

You can only have one active in the runtime code.

This normally happens to me when I have an interface and then have two implementations that I want to switch via config.

Autowire Conflict Resolution

There are two simple ways you can resolve the NoUniqueBeanDefinitionException exception in Spring. You can use the



The second way is to use the


Java 8 | Spring | React | Angular | CI/CD | Microservices | Monitoring |Apache Kafka.