Код: Выделить всё
@Configuration
public class DataQueue {
/**
* Queue to store the {@link SlowVars} read from the PLC
* @return the queue
*/
@Bean
Set slowVarsQueue() {
return new CopyOnWriteArraySet();
}
/**
* Queue to store the {@link JsonNode} events
* @return the queue
*/
@Bean
Set eventsQueue() {
return new CopyOnWriteArraySet();
}
}
Код: Выделить всё
@Log4j2
@RestController
@AllArgsConstructor
public class EventsApiImpl implements EventsApi {
private Set eventsQueue;
private MariaEventService mariaEventService;
private EventManipulationService eventManipulationService;
private ObjectMapper mapper;
// lots of methods
}
Код: Выделить всё
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean
with name 'slowVarsApiImpl': Unsatisfied dependency expressed through constructor parameter 0:
No qualifying bean of type 'java.util.Set[com.fasterxml.jackson.databind.JsonNode]' available:
expected single matching bean but found 2: slowVarsQueue,eventsQueue
Подробнее здесь: https://stackoverflow.com/questions/785 ... ut-found-2
Мобильная версия