Hi,
I have made a Saga, and the method annotated with both @StartSaga and @SagaEventHandler is triggered when I from the class looking like this:
public class RunSupplierSaga {
static Logger log = LoggerFactory.getLogger(RunSupplierSaga.class);
@SuppressWarnings(“unchecked”)
public static void main(String[] args) throws InterruptedException {
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(“spring-context.xml”);
EventBus eventBus = applicationContext.getBean(EventBus.class);
log.debug(“About to pubish a TransportOrderSentEvent”);
eventBus.publish(asEventMessage(new TransportOrderSentEvent(“123”)));
applicationContext.close();
}
}
The event fired when the CreateSupplierOrderCommand is handled is not handled by the SupplierSaga, and I don’t understand why. Here are all the classes involoved: http://pastie.org/9131603
and here is the log output when I also print debug for axon framework:
2014-05-01 21:40:44,596 [main] INFO - ContentTypeConverter of type [class org.axonframework.serializer.xml.Dom4JToByteArrayConverter] is ignored. It seems to rely on a class that is not available in the class loader: org/dom4j/Document
2014-05-01 21:40:44,598 [main] INFO - ContentTypeConverter of type [class org.axonframework.serializer.xml.InputStreamToDom4jConverter] is ignored. It seems to rely on a class that is not available in the class loader: org/dom4j/Document
2014-05-01 21:40:45,085 [main] DEBUG - Mongo Options
2014-05-01 21:40:45,085 [main] DEBUG - Connections per host :100
2014-05-01 21:40:45,085 [main] DEBUG - Connection timeout : 10000
2014-05-01 21:40:45,085 [main] DEBUG - Max wait timeout : 120000
2014-05-01 21:40:45,085 [main] DEBUG - Threads allowed to block : 5
2014-05-01 21:40:45,085 [main] DEBUG - Autoconnect retry : false
2014-05-01 21:40:45,085 [main] DEBUG - Socket timeout : 0
2014-05-01 21:40:45,119 [main] INFO - ContentTypeConverter of type [class org.axonframework.serializer.xml.Dom4JToByteArrayConverter] is ignored. It seems to rely on a class that is not available in the class loader: org/dom4j/Document
2014-05-01 21:40:45,119 [main] INFO - ContentTypeConverter of type [class org.axonframework.serializer.xml.InputStreamToDom4jConverter] is ignored. It seems to rely on a class that is not available in the class loader: org/dom4j/Document
2014-05-01 21:40:45,198 [main] DEBUG - About to pubish a TransportOrderSentEvent
2014-05-01 21:40:45,199 [main] DEBUG - Looking for IdentifierFactory implementation using the context class loader
2014-05-01 21:40:45,199 [main] DEBUG - Looking for IdentifierFactory implementation using the IdentifierFactory class loader.
2014-05-01 21:40:45,200 [main] DEBUG - Using default UUID-based IdentifierFactory
2014-05-01 21:40:45,265 [main] DEBUG - ***** TransportOrderSentEvent FIRED, id: 123
2014-05-01 21:40:45,344 [main] DEBUG - L1 - Starting SupplierSaga for purchaseOrderId ‘123’ -> ‘supplier-order-id-1’ (supplierOrderId)
2014-05-01 21:40:45,344 [main] DEBUG - Dispatching command [com.navarsete.stand012.supplier.command.CreateSupplierOrderCommand]
2014-05-01 21:40:45,347 [main] DEBUG - Starting Unit Of Work.
2014-05-01 21:40:45,348 [main] DEBUG - Registering Unit Of Work as CurrentUnitOfWork
2014-05-01 21:40:45,348 [main] DEBUG - handle CreateSupplierOrderCommand for purchaseOrderId ‘supplier-order-id-1’
2014-05-01 21:40:45,356 [main] DEBUG - Registering listener: org.axonframework.repository.LockingRepository$LockCleaningListener
2014-05-01 21:40:45,356 [main] DEBUG - Committing Unit Of Work
2014-05-01 21:40:45,356 [main] DEBUG - Notifying listeners of commit request
2014-05-01 21:40:45,357 [main] DEBUG - Notifying listener [org.axonframework.repository.LockingRepository$LockCleaningListener] of upcoming commit
2014-05-01 21:40:45,357 [main] DEBUG - Listeners successfully notified
2014-05-01 21:40:45,357 [main] DEBUG - Persisting changes to aggregates
2014-05-01 21:40:45,357 [main] DEBUG - Persisting changes to [com.navarsete.stand012.supplier.SupplierOrder], identifier: [supplier-order-id-1]
2014-05-01 21:40:45,388 [main] DEBUG - 1 events appended
2014-05-01 21:40:45,389 [main] DEBUG - Aggregates successfully persisted
2014-05-01 21:40:45,389 [main] DEBUG - This Unit Of Work is not nested. Finalizing commit…
2014-05-01 21:40:45,389 [main] DEBUG - Publishing events to the event bus
2014-05-01 21:40:45,389 [main] DEBUG - Publishing event [com.navarsete.stand012.supplier.event.SupplierOrderCreatedEvent] to event bus [org.axonframework.eventhandling.ClusteringEventBus@3ff5022b]
2014-05-01 21:40:45,390 [main] DEBUG - Registering listener: org.axonframework.eventhandling.SimpleCluster$MonitorInvoker
2014-05-01 21:40:45,391 [main] DEBUG - All events successfully published.
2014-05-01 21:40:45,391 [main] DEBUG - Notifying listeners after commit
2014-05-01 21:40:45,391 [main] DEBUG - Notifying listener [org.axonframework.eventhandling.SimpleCluster$MonitorInvoker] after commit
2014-05-01 21:40:45,391 [main] DEBUG - Notifying listener [org.axonframework.repository.LockingRepository$LockCleaningListener] after commit
2014-05-01 21:40:45,391 [main] DEBUG - Stopping Unit Of Work
2014-05-01 21:40:45,391 [main] DEBUG - Notifying listeners of cleanup
2014-05-01 21:40:45,391 [main] DEBUG - Notifying listener [org.axonframework.eventhandling.SimpleCluster$MonitorInvoker] of cleanup
2014-05-01 21:40:45,391 [main] DEBUG - Notifying listener [org.axonframework.repository.LockingRepository$LockCleaningListener] of cleanup
2014-05-01 21:40:45,391 [main] DEBUG - Listeners successfully notified
2014-05-01 21:40:45,391 [main] DEBUG - Clearing resources of this Unit Of Work.
2014-05-01 21:40:45,391 [main] INFO - Command executed successfully: com.navarsete.stand012.supplier.command.CreateSupplierOrderCommand