Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.14.0
-
None
-
None
Description
Running `gfsh -e connect` on a locator at the wrong time results in this error:
Exception caused JMX Manager startup to fail because: 'Manager is already running'
Looking at where this message is generated, I think this is coming from this code in JmxLocatorManager that tries to find a JMX manager and start one if it is not running
//*** Manager may not be started at this point List<JmxManagerProfile> alreadyManaging = this.cache.getJmxManagerAdvisor().adviseAlreadyManaging(); if (alreadyManaging.isEmpty()) { List<JmxManagerProfile> willingToManage = this.cache.getJmxManagerAdvisor().adviseWillingToManage(); if (!willingToManage.isEmpty()) { synchronized (this) { alreadyManaging = this.cache.getJmxManagerAdvisor().adviseAlreadyManaging(); if (alreadyManaging.isEmpty()) { willingToManage = this.cache.getJmxManagerAdvisor().adviseWillingToManage(); if (!willingToManage.isEmpty()) { JmxManagerProfile p = willingToManage.get(0); if (p.getDistributedMember().equals(this.cache.getMyId())) { if (logger.isDebugEnabled()) { logger.debug("Locator starting jmx manager in its JVM"); } try { //*** This call can throw an AlreadyRunningException if the manager is already running //*** failing this whole method. ManagementService.getManagementService(this.cache).startManager(); } catch (CancelException ex) { // ignore } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err); // If this ever returns, rethrow the error. We're poisoned // now, so don't let this thread continue. throw err; } catch (Throwable t) { SystemFailure.checkFailure(); return new JmxManagerLocatorResponse(null, 0, false, t); }