Github user lahirus commented on a diff in the pull request: https://github.com/apache/stratos/pull/354#discussion_r30730518 --- Diff: components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/util/AutoscalerUtil.java --- @@ -773,19 +773,34 @@ public void updateApplicationsTopology(Application application) for (Group existingGroup : existingGroups) { Group newGroup = application.getGroupRecursively(existingGroup.getUniqueIdentifier()); if (newGroup != null) { - //Finding the GroupMonitor based on ApplicationMonitor - GroupMonitor groupMonitor = (GroupMonitor) AutoscalerContext.getInstance(). - getAppMonitor(application.getUniqueIdentifier()). - findGroupMonitorWithId(existingGroup.getUniqueIdentifier()); - //Updating the GroupMonitor - for (NetworkPartitionContext networkPartitionContext : groupMonitor. - getNetworkPartitionContextsMap().values()) { - ((ParentLevelNetworkPartitionContext) networkPartitionContext). - setMinInstanceCount(newGroup.getGroupMinInstances()); - ((ParentLevelNetworkPartitionContext) networkPartitionContext). - setMaxInstanceCount(newGroup.getGroupMaxInstances()); + + ApplicationMonitor applicationMonitor = AutoscalerContext.getInstance(). + getAppMonitor(application.getUniqueIdentifier()); + + if (applicationMonitor != null) { + //Finding the GroupMonitor based on ApplicationMonitor + GroupMonitor groupMonitor = (GroupMonitor) applicationMonitor. + findGroupMonitorWithId(existingGroup.getUniqueIdentifier()); + + if (groupMonitor != null) { + //Updating the GroupMonitor + for (NetworkPartitionContext networkPartitionContext : groupMonitor. + getNetworkPartitionContextsMap().values()) { + ((ParentLevelNetworkPartitionContext) networkPartitionContext). + setMinInstanceCount(newGroup.getGroupMinInstances()); + ((ParentLevelNetworkPartitionContext) networkPartitionContext). + setMaxInstanceCount(newGroup.getGroupMaxInstances()); + } + } } + --- End diff -- Please remove the commented code.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---