ARTEMIS-992 NPE on startup
This commit is contained in:
parent
fd0513e4f5
commit
81b5563a52
|
@ -1574,4 +1574,7 @@ public interface ActiveMQServerLogger extends BasicLogger {
|
|||
@Message(id = 224075, value = "Cannot find pageTX id = {0}", format = Message.Format.MESSAGE_FORMAT)
|
||||
void journalCannotFindPageTX(Long id);
|
||||
|
||||
@LogMessage(level = Logger.Level.ERROR)
|
||||
@Message(id = 224076, value = "No cluster locator found. This server will not participate in a cluster. Ensure a valid cluster-connection is configured.", format = Message.Format.MESSAGE_FORMAT)
|
||||
void noClusterLocatorFound();
|
||||
}
|
||||
|
|
|
@ -106,6 +106,9 @@ public class ClusterController implements ActiveMQComponent {
|
|||
} else {
|
||||
replicationLocator = defaultLocator;
|
||||
}
|
||||
if (replicationLocator == null) {
|
||||
ActiveMQServerLogger.LOGGER.noClusterLocatorFound();
|
||||
}
|
||||
//latch so we know once we are connected
|
||||
replicationClusterConnectedLatch = new CountDownLatch(1);
|
||||
//and add the quorum manager as a topology listener
|
||||
|
@ -198,7 +201,9 @@ public class ClusterController implements ActiveMQComponent {
|
|||
* @param listener
|
||||
*/
|
||||
public void addClusterTopologyListenerForReplication(ClusterTopologyListener listener) {
|
||||
replicationLocator.addClusterTopologyListener(listener);
|
||||
if (replicationLocator != null) {
|
||||
replicationLocator.addClusterTopologyListener(listener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue