Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
scmod opened this issue Dec 7, 2023 · 0 comments

Comments

@scmod
Copy link

scmod commented Dec 7, 2023

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<>();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant