After Upgrading Spring packages from 4.3 to 5.3 I am seeing below error in my service. It was working fine before upgrade
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.lang.String' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier("customendpoint")}
Here is sample code
@Configuration public class HttpServerConfig {
@Autowired
@Qualifier("customendpoint")
private String endpoint;
@Bean(name = "customendpoint")
String getEndpoint() throws IOException {
String enpval = 'hello.world.com'
return enpval;
}
@Bean
public Orchestrator orchestrator() {
Preconditions.checkNotNull(chainHelper);
OrchestratorHelper orchestratorHelper = new OrchestratorHelper(chainHelper, 30_000);
ABCOrchestrator abcOrchestrator = new ABCOrchestrator(orchestratorHelper);
return Orchestrator.builder()
.withDelegate(abcOrchestrator)
.withServiceName(endpoint)
.build();
}
}
}
Upgraded Spring packages to 5 from 4