Setup Axon 4.4 + axon-cdi 4.0-alpha1

Hello all,

For some days I am fighting to have my setup to work. I want to try out a configuration without Spring.

I have a very simple setup with JPA event store and it seems to work since the error I am facing is not what my test says:

My fixtureConfiguration test works as expected

    .when(new CreateEmployee(new EmployeeId("1234"), "John", "Constantine",
        new EmployeeCreated(new EmployeeId("1234"), "John", "Constantine",;

But when I ran it locally I got the following error:

Resulted in: org.jboss.resteasy.spi.UnhandledException: org.axonframework.commandhandling.NoHandlerForCommandException: No handler was subscribed to command []

My config so far:

public EventStorageEngine eventStorageEngine() {
    return JpaEventStorageEngine.builder()

public Configuration axonConfiguration() {
    return DefaultConfigurer.defaultConfiguration()
            config ->
                        config.messageMonitor(AsynchronousCommandBus.class, "commandBus"))
            conf -> EmbeddedEventStore.builder().storageEngine(eventStorageEngine()).build())

I didn’t find any code sample with a complete config for non-spring or non-AxonServer projects, someone face the same or is trying something similar?

Hello Rogério,

Could you also share the code snippet with the CommandHandler for the CreateEmployee command?



Hi @Yvonne_Ceelie!

Here you have:

import org.axonframework.cdi.stereotype.Aggregate;
import org.axonframework.commandhandling.CommandHandler;
import org.axonframework.eventsourcing.EventSourcingHandler;
import org.axonframework.modelling.command.AggregateIdentifier;

public class Employee {

  @AggregateIdentifier private EmployeeId id;
  private String name;
  private String surname;
  private LocalDate birthday;

  public Employee(CreateEmployee createEmployee) {
        new EmployeeCreated(

  public void on(EmployeeCreated event) { =; =;
    this.surname = event.surname();
    this.birthday = event.birthday();

  public Employee() {
    // Axon required

Trying to troubleshoot the issue it seems that command handler was not recognized and as result not added in the subscriptions Map.

Does the CreateEmployee have the id annotated with TargetAggregateIdentifier?

I thought I have also added this one:

public class CreateEmployee {
  @NotBlank @AggregateIdentifier private final EmployeeId employeeId;

  @NotBlank(message = "Name cannot be blank")
  private final String name;

  @NotBlank(message = "Surname cannot be blank")
  private final String surname;

  @PastOrPresent(message = "The birthday cannot be on future")
  private final LocalDate birthday;

//constructor suppressed
//getters suppressed


You should use the TargetAggregateIdentifier instead of AggregateIdentifier there.

Doh! Stupid mistake, even though I have the same issue.

Is there something else needed to register a command handler?

I tried before to register manually in the config using registerCommandHandler and configureAggregate but I got the same issue

Do you use the same commandBus implementation in your test as the one on which the handler is registered?

I have no special config for testing, I am just using the regular fixture

class EmployeeTest {

  private FixtureConfiguration<Employee> fixture;

  public void setup() {
    fixture = new AggregateTestFixture<>(Employee.class);

Make sense to share my project? Is it just a PoC there is no privacy or business secret to prevent any sharing

Yes, that’s fine I’ll take a look.

Hi @Yvonne_Ceelie I would like to thank you for any advise that can help here

The code is hosted here

The steps I am using to run it are:

  1. docker-compose up
  2. ./gradlew clean quarkusDev
  3. curl -v -H “Content-Type: application/json” -d ‘{“employeeId”: “1235”, “name”: “John”, “surname”: “Constantine”, “birthday”: “1970-10-23”}’ localhost:8080/v1/employee

I have no issues running Axon with Spring + Mongo, but this new setup I am trying is really tough