if(keys.size()==0){
throw new DiagnosticException("Cannot collect diagnostic information for cluster [ "+target.getName()+" ] without any instance");
}
try
{
ConfigContext configContext = com.sun.enterprise.admin.server.core.AdminService.getAdminService().getAdminContext().getAdminConfigContext();
Domain domain = ServerBeansFactory.getDomainBean(configContext);
Clusters clusters = domain.getClusters();
Cluster targetCluster = clusters.getClusterByName(target.getName());
boolean captureHadbInfoEnabled = isHadbCaptureEnabled(configContext,targetCluster.getName());
addHadbInfoCollector(captureHadbInfoEnabled, target.getName(), reportDir);
}
catch(ConfigException ce){
logger.log(Level.WARNING,
"Config Exception" ,ce);
}
catch(DiagnosticException de){
logger.log(Level.WARNING,
"Diagnostic Exception" ,de);
}
}
if(target.getType().equals(EETargetType.DOMAIN)){
try{
ConfigContext configContext = com.sun.enterprise.admin.server.core.AdminService.getAdminService().getAdminContext().getAdminConfigContext();
Domain domain = ServerBeansFactory.getDomainBean(configContext);
Clusters clusters = domain.getClusters();
Cluster clusterArray[] = clusters.getCluster();
boolean captureHadbInfoEnabled=false;