Here is my sample code. This was working fine in 5.2 but when I upgraded to 5.3.13 it threw error "org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'UtilBean< DefaultBeanUtil >' available"

Interface BaseUtil{}

@Component
Class DefaultBeanUtil implements BaseUtil{
}
@Component
@Scope(scopeName=ConfigurableBeanFactory.SCOPE_PROTOTYPE)
Class UtilBean<T extends BaseUtil> {
}
@Component
Class MyBean {
public void doSomething(){
  getUtilBean().doSomething();
}

 @Lookup
  public UtilBean<DefaultBeanUtil> getUtilBean() {
    return null;
  }
}

I can also see we have done some changes in here https://github.com/spring-projects/spring-framework/issues/26998

Comment From: kse-music

As mentioned in #26998 , the lookup autowire takes into account the generic type of the method return type, and none of the UtilBean bean generics in your code is DefaultBeanUtil.However, it was not considered in the previous version. So I feel that I am confused here whether we should consider generics?

Comment From: vgaur

I think we should not consider generics. And in the case of #26998 We always have a way to use qualifiers.

In my sample code It works if I remove generics

 @Lookup
  public UtilBean getUtilBean() {
    return null;
  }

So essentially in this case we are ignoring it. I can not define bean of UtilBean of all possible implementation of BaseUtil.

Comment From: snicoll

The exception looks legit to me. You're asking to inject a UtilBean<DefaultBeanUtil> and none of the bean in your sample matches that signature.