We using axon 3.0.7 with spring boot 1.5.7.RELEASE and every thing was working correctly until we decided to put all our domain logic in a separate package that can be referenced by multiples projects without rewriting the code e.g events, command and aggregates. everything compiles and runs but we now getting:
org.axonframework.commandhandling.NoHandlerForCommandException: No handler was subscribed to command
Anthony’s approach to having separate packages seems reasonable and normally in Spring you can add basePackages to component scans so that Spring will find them. Is that not the case with Axon? i.e. if one adds the separate package name to Spring’s scanning config i.e.
Axon doesn’t do any classpath scanning itself. When using it in combination with Spring, it uses the application context to autoconfigure its components. So if Spring finds it, Axon will use it. And yes, setting base packages for your Spring Boot application will definitely work.