CommandGateway is null on Saga

I followed (best I could) the coding session on the following page.

http://info.trifork.com/Axon3-LiveCoding-03.html

While the bank Saga works on the test cases, the SpringBoot version does not. The CommandGateway is null (not injected). The page does not have a link to the completed source and wonder if someone has tried the examples. Also, there are some changes from the older M3-5 versions to the RC.

I tried injecting the CommandGateway as well as passing as a parameter to the SagaEventHandlers with no luck.
I am trying the SpringBoot version

Thanks anyway

Hi,

I have put the code related to the webinar on my github account: https://github.com/abuijze/webinar-axon-bank

Did you put an @Inject annotation of the field or setter?

Cheers,

Allard

Thank you very much. I apologize for the delayed reply but we had a holiday here in the US last Thursday.

Hi

I am also facing the same issue and also tried the code from Git location mentioned below. No luck. Any specific thing do I need to try?

Hi Amit,

You could try both the ‘@Inject’ and ‘@Autowired’ annotation for Axon to wire the bean in to your Saga implementation.
Those annotation need to be put on the global parameter level or on a setter function, not a constructor.
If both don’t work, you could go the stretch to implement your own ‘ResourceInjector’, as that’s the interface used to inject beans into Sagas within Axon.

Hope some of these suggestions help you out.

Cheers,

Steven

Hi,

what configuration do you have? Adding the @Saga annotation to your Saga class is really all you need to do.

Allard

Make sure that you use version 3.0 of the axon framework in your pom.xml. Changing the version fixed it for me.

Note that the latest release is 3.1.2.

Cheers,

Allard