@Aggregate
public class AccessorAggregateRoot implements Serializable {
private static final long serialVersionUID = -6507215786865192829L;
@AggregateIdentifier
private AccessorId accessorId;
...
}
@Configuration
public class AccessorCommandConfiguration {
@Bean
Repository<AccessorAggregateRoot> accessorAggregateRootRepository(AxonConfiguration axonConfiguration) {
return axonConfiguration.repository(AccessorAggregateRoot.class);
}
}
@Component
public class AccessorCommandHandler implements IAggregateLoader<AccessorAggregateRoot, AccessorId> {
private Repository<AccessorAggregateRoot> accessorRepository;
private PasswordEncoder passwordEncoder;
@Autowired
public AccessorCommandHandler(
Repository<AccessorAggregateRoot> accessorAggregateRootRepository, PasswordEncoder passwordEncoder) {
this.accessorRepository = accessorAggregateRootRepository;
this.passwordEncoder = passwordEncoder;
}
}
BeanCurrentlyInCreationException: Error creating bean with name 'accessorAggregateRootRepository': Requested bean is currently in creation: Is there an unresolvable circular reference?
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in net.docucom.cloud.accessor.command.AccessorCommandHandler required a bean of type 'org.axonframework.commandhandling.model.Repository' that could not be found.
Action:
Consider defining a bean of type 'org.axonframework.commandhandling.model.Repository' in your configuration.
@Configuration
public class AccessorCommandConfiguration {
@Bean
AccessorCommandHandler accessorCommandHandler(AxonConfiguration axonConfiguration, PasswordEncoder passwordEncoder) {
return new AccessorCommandHandler(axonConfiguration.repository(AccessorAggregateRoot.class), passwordEncoder);
}
}
--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I also got this problem in axon 3.2.
@Autowired
private Repository<Account> accountRepository;
--
@Component
public clsss OrderCommandHandler {
@Autowired
private Repository<Order> orderRepository;
@Autowired
private Repository<OrderProduct> orderProductRepository;
@CommandHandler
public void handle(SomeCommand cmd) {
...
}
}
I