I am getting NonUniqueBeanException: Multiple possible bean candidates found: for the below Micronaut code:
@Context
@Slf4j
@AllArgsConstructor
public class RemoteService {
private final Provider<Session> remoteSessionFactory;
}
I have 2 implementations for the Provider
@Slf4j
@Prototype
@AllArgsConstructor
public class RemoteSessionFactoryA implements Provider<Session> {
//some code here
}
@Slf4j
@Prototype
@AllArgsConstructor
public class RemoteSessionFactoryB implements Provider<Session> {
//some code here
}
I have even tried like this but still getting the same error:
private final @Named("remoteSessionFactoryA) Provider<Session> remoteSessionFactory;
Please suggest how to resolve this.
Regards