ARTEMIS-992 NPE on startup

This commit is contained in:
Justin Bertram 2017-03-30 14:19:56 -05:00 committed by Clebert Suconic
parent fd0513e4f5
commit 81b5563a52
2 changed files with 9 additions and 1 deletions

View File

@ -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();
}

View File

@ -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);
}
}
/**