holunda-io / camunda-bpm-taskpool

Library for pooling user tasks and process related business objects.
https://www.holunda.io/camunda-bpm-taskpool/
Apache License 2.0
68 stars 26 forks source link

Support Axon Framework 4.6.x #654

Closed jangalinski closed 2 years ago

jangalinski commented 2 years ago

Scenario

I am updating my current application to axon 4.6.1. I get a cyclic dependency error:

Current Behaviour

The dependencies of some of the beans in the application context form a cycle:

   createTaskCommandHandler defined in URL [jar:file:/Users/jangalinski/.m2/repository/io/holunda/polyflow/polyflow-taskpool-core/3.3.2/polyflow-taskpool-core-3.3.2.jar!/io/holunda/polyflow/taskpool/core/task/CreateTaskCommandHandler.class]
      ↓
   taskAggregateRepository defined in class path resource [io/holunda/polyflow/taskpool/core/TaskPoolCoreConfiguration.class]
┌─────┐
|  eventStore defined in class path resource [org/axonframework/springboot/autoconfig/AxonServerBusAutoConfiguration.class]
↑     ↓
|  springAxonConfiguration defined in class path resource [org/axonframework/springboot/autoconfig/InfraConfiguration.class]
↑     ↓
|  springAxonConfigurer defined in class path resource [org/axonframework/springboot/autoconfig/InfraConfiguration.class]
↑     ↓
|  processDefinitionAggregate$$Registrar
↑     ↓
|  processDefinitionAggregateRepository defined in class path resource [io/holunda/polyflow/taskpool/core/TaskPoolCoreConfiguration.class]
└─────┘

Wanted Behaviour

polyflow can be used with axon 4.6.

Possible Workarounds

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.
jangalinski commented 2 years ago

Workaround fails:

Despite circular references being allowed, the dependency cycle between beans could not be broken. Update your application to remove the dependency cycle.