I have issue deploying Axon application, here is my configuration and error message.
Enter code here...
`
@Configuration
public class AxonConfig {
@Autowired
private AxonConfiguration axonConfiguration;
@Autowired
private EventBus eventBus;
@Bean
public com.isslng.schooloffice.handler.AccountCommandHandler accountCommandHandler() {
return new com.isslng.schooloffice.handler.AccountCommandHandler(axonConfiguration.repository(Account.class), eventBus);
}
@Bean
public SagaConfiguration TransactionPostManagementSagaConfiguration() {
return SagaConfiguration.trackingSagaManager(TransactionPostManagementSaga.class);
}
@Autowired
public void configure(@Qualifier(“localSegment”) SimpleCommandBus simpleCommandBus) {
simpleCommandBus.registerDispatchInterceptor(new BeanValidationInterceptor<>());
}
}
`
Enter code here...
Enter code here...
`
`
`
@Data
@Slf4j
@Aggregate
public class Account {//extends AbstractAggregateRoot {
@AggregateIdentifier
private String id;
private String AccountName;
private List userId;
private AccountingType type;
public Account() {
}
@CommandHandler
public Account(CreateAccountCommand command){
apply(new CreateAccountEvent(command.getId(),command.getAccountName(), command.getUserId()));
}
public void debit(Double amount, String transactionId) {
log.info(“Post debit with payload {}”, transactionId);
apply(new SourceAccountDebitedEvent(id, transactionId, amount));
}
public void credit(Double amount, String transactionId) {
apply(new DestinationAccountCreditedEvent(id,transactionId, amount ));
}
@EventSourcingHandler
public void on(CreateAccountEvent event) {
this.id = event.getId();
this.AccountName = event.getAccountName();
this.userId = event.getUserId();
}
public enum AccountingType{
DEBIT,
CREDIT;
}
}
@Slf4j
@Transactional
public class AccountCommandHandler {
private Repository repository;
private EventBus eventBus;
// @Autowired
public AccountCommandHandler(Repository repository, EventBus eventBus) {
this.repository = repository;
this.eventBus = eventBus;
}
@CommandHandler
public void handle(DebitAccountCommand command) {
try {
log.info(“Post DebitAccountCommand with payload {}”,command);
Aggregate AccountAggregate = repository.load(command.getAccount());
AccountAggregate.execute(account ->
account.debit(command.getAmount(), command.getTransactionId()));
} catch (AggregateNotFoundException exception) {
eventBus.publish(asEventMessage(new DebitAccountNotFoundEvent(command.getTransactionId())));
}
}
@CommandHandler
public void handle(CreditAccountCommand command) {
try {
log.info(“Post DebitAccountCommand with payload {}”,command.toString());
Aggregate AccountAggregate = repository.load(command.getAccount());
AccountAggregate.execute(account -> account
.credit(command.getAmount(), command.getTransactionId()));
}
catch (AggregateNotFoundException exception) {
eventBus.publish(asEventMessage(new CreditAccountNotFoundEvent(command.getTransactionId())));
}
}
}
Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled.
2017-07-20 16:51:56.860 ERROR 16504 — [st-startStop-37] o.s.b.d.LoggingFailureAnalysisReporter :