SagaCreationException without cause?

I’m teaching myself how to use Axon through a toy project and I’m on to sagas now. I’ve implemented my aggregate, saga and have tested both successfully using the Axon testing tools. However, when I run my application to test the integration of everything, I’m running into a SagaCreationException and the framework doesn’t give any insight into the cause. Is this by design? Is there a typical reason for this? Or might there be room for an improvement to the exception handler? The following is some log output to give a sense of what I’m experiencing from the terminal:

`

2018-08-20 16:55:16.606 DEBUG 3024 — [io-8080-exec-10] e.users.domain.aggregate.User : Received StartRegistrationCommand@10c379e8(userId=UserId@224c046b(identifier=bd822fc7-f832-456f-8d22-919dd4acfc1f),password=,emailAddress=@somewhere.com,verifyEmailAddressWithin=PT20S,completeRegistrationWithin=PT2M)
2018-08-20 16:55:16.689 DEBUG 3024 — [io-8080-exec-10] e.users.domain.aggregate.User : Received RegistrationStartedEvent@2601b493(userId=UserId@224c046b(identifier=bd822fc7-f832-456f-8d22-919dd4acfc1f),emailAddress=
@somewhere.com,passwordHash=**,verifyEmailAddressWithin=PT20S,completeRegistrationWithin=PT2M)
2018-08-20 16:55:16.691 DEBUG 3024 — [io-8080-exec-10] org.hibernate.SQL : select nextval (‘hibernate_sequence’)
Hibernate: select nextval (‘hibernate_sequence’)
2018-08-20 16:55:16.692 DEBUG 3024 — [io-8080-exec-10] org.hibernate.SQL : insert into domain_event_entry (event_identifier, meta_data, payload, payload_revision, payload_type, time_stamp, aggregate_identifier, sequence_number, type, global_index) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into domain_event_entry (event_identifier, meta_data, payload, payload_revision, payload_type, time_stamp, aggregate_identifier, sequence_number, type, global_index) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2018-08-20 16:55:16.698 DEBUG 3024 — [io-8080-exec-10] org.hibernate.SQL : select associatio0_.saga_id as col_0_0_ from association_value_entry associatio0_ where associatio0_.association_key=? and associatio0_.association_value=? and associatio0_.saga_type=?
Hibernate: select associatio0_.saga_id as col_0_0_ from association_value_entry associatio0_ where associatio0_.association_key=? and associatio0_.association_value=? and associatio0_.saga_type=?
2018-08-20 16:55:16.702 WARN 3024 — [io-8080-exec-10] o.a.c.gateway.DefaultCommandGateway : Command ‘example.users.domain.command.StartRegistrationCommand’ resulted in org.axonframework.eventhandling.saga.repository.SagaCreationException(An error occurred while attempting to create a new managed instance)
2018-08-20 16:55:16.704 DEBUG 3024 — [io-8080-exec-10] o.s.b.w.s.f.OrderedRequestContextFilter : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@5c92dc67

`

Upon thinking about this a bit more, I wonder if this is because I’m using a subscribing process when I should be using a tracking processor for my saga. I just realized that the aggregate does not appear to be committed to the event store yet, and the sage might be able to be started because the aggregate does not yet exist.

Does that sound plausible?

Well, I configured Axon to use tracking processors by default, but that did not improve the situation.

For the record, I filed this issue after some further investigation.

Hi Matt,

First off, sorry for keeping you in the dark on this for so long.

After I noticed from this thread that you introduced an issue with a fair explanation of what you did and how you got there, I figured you had resolved the immediate problem you were encountering.

Nonetheless, the issue still sounds valid, although it will need some further discussion here on what we’re going to do exactly.

I think you suggestion around logging in some form does sound reasonable and isn’t to hard to introduce.

It should have been clearer that the creation of your saga wasn’t possible because a giving resource could not be injected, as we do add the exception which is catched to the new exception being thrown. Ergo, I would have expected a longer stack trace then which you have provided.

Maybe it had something to do with you Saga code…do you mind sharing a snippet, adding how the resource is set in that Saga?

Cheers,
Steven