* inside of virtual servers.
**/
public static String checkContextRootUniqueness(ConfigContext ctx, String appId, String targetName, String virtualServerList)
throws ConfigException, IASDeploymentException
{
ConfigBean appBean = ApplicationHelper.findApplication(ctx, appId);
if(appBean==null)
{
throw new ConfigException(_strMgr.getString("applicationElementIsNotFoundForName", appId));
}
//get context roots for testing element
String[] ctxRoots = getAppContextRoots(appBean);
if(ctxRoots==null || ctxRoots.length<=0)
return null;
//create target by name
final Target target = TargetBuilder.INSTANCE.createTarget(
new TargetType[]{TargetType.CLUSTER, TargetType.SERVER, TargetType.DAS}, targetName, ctx);
//get apprefs for target
ApplicationRef[] refs = null;
if (target.getType() == TargetType.CLUSTER ||
target.getType() == TargetType.STANDALONE_CLUSTER)
{
refs = ClusterHelper.getApplicationReferences(ctx, targetName);
}
else
{
refs = ServerHelper.getApplicationReferences(ctx, targetName);
}
if(refs==null)
return null;
for(int i=0; i<refs.length; i++)
{
if(isVSListsIntersected(refs[i].getVirtualServers(), virtualServerList))
{
ConfigBean appBeanToCompare = ApplicationHelper.findApplication(ctx, refs[i].getRef());
if(appBeanToCompare==null)
{
throw new ConfigException(_strMgr.getString("applicationElementIsNotFoundForName", refs[i].getRef()));
}
if(((Object)appBeanToCompare)!=((Object)appBean))