Question from the Spring test

Spring: How to resolve a `NoUniqueBeanDefinitionException` when using @Autowired with a generic type

Medium

The following code

public interface AddressResolver{...}


@Component
public class GoogleMapAddressResolver implements AddressResolver{
  //...
}
 
@Component
public class CustomMapAddressResolver implements AddressResolver{
   //...
}
 
@Service
public class AddressService{
      
    @Autowired
    private AddressResolver addressResolver;
  //...
}
Author: W3D TeamStatus: Published(Update)Question passed 62 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!