pulsar-manager icon indicating copy to clipboard operation
pulsar-manager copied to clipboard

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

Open scmod opened this issue 2 years ago • 0 comments

packaged from master branch start failed with an error

***************************
APPLICATION FAILED TO START
***************************

Description:

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

   bookiesController defined in URL [jar:file:/home/hubo/pulsar-manager/lib/pulsar-manager.jar!/org/apache/pulsar/manager/controller/BookiesController.class]
      ↓
   bookiesServiceImpl defined in URL [jar:file:/home/hubo/pulsar-manager/lib/pulsar-manager.jar!/org/apache/pulsar/manager/service/impl/BookiesServiceImpl.class]
┌─────┐
|  environmentCacheServiceImpl defined in URL [jar:file:/home/hubo/pulsar-manager/lib/pulsar-manager.jar!/org/apache/pulsar/manager/service/impl/EnvironmentCacheServiceImpl.class]
↑     ↓
|  pulsarAdminServiceImpl (field private org.apache.pulsar.manager.service.EnvironmentCacheService org.apache.pulsar.manager.service.impl.PulsarAdminServiceImpl.environmentCacheService)
└─────┘

some fields may not be autowired from constructor of environmentCacheServiceImpl
I've made change like this

@Service
public class EnvironmentCacheServiceImpl implements EnvironmentCacheService {

    @Autowired
    private EnvironmentsRepository environmentsRepository;

    private final Map<String, Map<String, ClusterData>> environments;
	
    @Autowired
    private PulsarAdminService pulsarAdminService;

    private final Map<String, String> serviceUrlEnvironmentMap;

    public EnvironmentCacheServiceImpl() {
        this.environments = new ConcurrentHashMap<>();
        this.serviceUrlEnvironmentMap = new ConcurrentHashMap<>();
    }

scmod avatar Dec 07 '23 06:12 scmod