camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.12k stars 1.56k forks source link

Circular reference error occurred during use 7.20.0-alpha3 #3574

Closed royalzzz closed 1 year ago

royalzzz commented 1 year ago

Environment

Description

When using the Spring Cloud Consul Discovery and Spring Security components, a circular reference error occurred.

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

   org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration
      ↓
   securityFilterChain defined in class path resource [com/goodscattle/security/config/SecurityConfiguration.class]
      ↓
   mvcHandlerMappingIntrospector defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]
      ↓
   healthEndpointWebMvcHandlerMapping defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointWebExtensionConfiguration$MvcAdditionalHealthEndpointPathsConfiguration.class]
┌─────┐
|  healthEndpoint defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]
↑     ↓
|  healthContributorRegistry defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]
↑     ↓
|  org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration (field private org.camunda.bpm.engine.ProcessEngine org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration.processEngine)
↑     ↓
|  processEngineFactoryBean
↑     ↓
|  consulAutoServiceRegistrationListener defined in class path resource [org/springframework/cloud/consul/serviceregistry/ConsulAutoServiceRegistrationAutoConfiguration.class]
↑     ↓
|  consulAutoServiceRegistration defined in class path resource [org/springframework/cloud/consul/serviceregistry/ConsulAutoServiceRegistrationAutoConfiguration.class]
↑     ↓
|  consulServiceRegistry defined in class path resource [org/springframework/cloud/consul/serviceregistry/ConsulServiceRegistryAutoConfiguration.class]
↑     ↓
|  ttlScheduler defined in class path resource [org/springframework/cloud/consul/support/ConsulHeartbeatAutoConfiguration.class]
↑     ↓
|  actuatorHealthStatusProvider defined in class path resource [org/springframework/cloud/consul/support/ConsulHeartbeatAutoConfiguration$ActuatorBasedApplicationStatusProviderConfig.class]
└─────┘

Steps to reproduce

If necessary, I can provide the minimum sample project.

Observed Behavior

Circular reference error occurred.

royalzzz commented 1 year ago

Here is my sample project

How-to-run:

Modify the following configuration in application.yml file.

cloud:
  consul-host: 127.0.0.1
  consul-port: 8500
  pgsql-host: 127.0.0.1
  pgsql-port: 5432

You can run following command to start consul and postgresql service.

docker run -d --name=consul-dev -p 8500:8500 hashicorp/consul

mkdir -p /dev/pgsql

docker run -d --name postgres \
    -e POSTGRES_PASSWORD=camunda \
    -e PGDATA=/var/lib/postgresql/data/pgdata \
    -v /dev/pgsql:/var/lib/postgresql/data \
    -p 5432:5432 postgis/postgis
royalzzz commented 1 year ago

There is also a triggering condition for this issue, where time events are used as starting events in bpmn.

danielkelemen commented 1 year ago

Hi @royalzzz, thanks for opening the issue!

If necessary, I can provide the minimum sample project.

In that case, please provide a sample project.

-Daniel

royalzzz commented 1 year ago

https://github.com/royalzzz/camunda-starter-sample

Hi @royalzzz, thanks for opening the issue!

If necessary, I can provide the minimum sample project.

In that case, please provide a sample project.

-Daniel

danielkelemen commented 1 year ago

Hi @royalzzz,

I've found this old issue: https://github.com/camunda/camunda-bpm-spring-boot-starter/issues/148 I tried it and after adding the @EnableProcessApplication annotation the problem disappeared.

I hope it helps. If the problem still persists, feel free to reopen the issue.

-Daniel