State-Stored Aggregates: No handler was subscribed to command


I am following the example to store the aggregate as-is-too on a table, but for some reason the @CommandHandler on the constructor of the class is not detcted throwing a NoHandleForCommandException(No handler was subscribed to command…). The only option to enable the @CommandHandler o is change the @Entity to @Aggregate.

How Axon can detected a @CommandHandler for a @Entity?.

Jose Coronel

Hi Jose,

you will need to add both Axon’s @Aggregate as well as Hibernate’s @Entity to create a state-stored aggregate. If you remove the @Aggregate, then Axon doesn’t see that class as one that could potentially handle commands.