apache / apache/pulsar-manager

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

Open
#542 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
539
Forks
239
PR merge metrics
No merged PRs in 30d

Description

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> environments;

@Autowired
private PulsarAdminService pulsarAdminService;

private final Map serviceUrlEnvironmentMap;

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.