holixon / axon-cdi

CDI Extension to use AxonFramework 3.x in Container Environments
Apache License 2.0
4 stars 1 forks source link

Fix BeanManager discovery in WELD SE environment #4

Closed zambrovski closed 6 years ago

zambrovski commented 6 years ago

Current example is based on WELD SE implementation of CDI.

Access to JNDI is not available and should be fixed somehow to make example work.

In JNDI environments, the extension will work, but in WELD SE, the access to BeanManager can be provided by the container. The problem with it is that we have to deal with different access methods for the BeanManager. This access must be static (can't be Injected) because we require the BeanManager instance before CDI setup is finished.

alexmacavei commented 6 years ago

Hey, I've created an example myself and it seems to have a BeanManager creation issue. Might be related to this one, but I think this morning I didn't have this problem. Here's my example https://github.com/alexmacavei/cqrs-example If I run configurer.buildConfiguration() (in AxonCdiExtension class) twice, the second time it resolves just fine, but then I bump into the CommandHandler issue. But this is real weird...

zambrovski commented 6 years ago

Hold on. This could be the problem. Maybe I screwed up the registration order.