DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
//factory.setValidating(false);
factory.setNamespaceAware(true);
try {
DocumentBuilder builder = factory.newDocumentBuilder();
DocumentBuilder builderDomainXml = factory.newDocumentBuilder();
builderDomainXml.setEntityResolver((org.xml.sax.helpers.DefaultHandler)Class.forName
("com.sun.enterprise.config.serverbeans.ServerValidationHandler").newInstance());
Element docEle = builderDomainXml.parse(new File(lbFile)).getDocumentElement();
NodeList clEles = docEle.getElementsByTagName("cluster");
for(int lh =0; lh < clEles.getLength(); lh++){
clusters.add(new LBCluster((Element)clEles.item(lh)));
}
NodeList propEles = docEle.getElementsByTagName("cluster");
for(int ph =0; ph < propEles.getLength(); ph++){
Element propsEle = (Element)propEles.item(ph);
lbProperties.setProperty(propsEle.getAttribute("name"),propsEle.getAttribute("value"));
}
}catch (Exception ex){
log.severe(stringManager.getString("upgrade.transform.startFailureMessage", ex.getMessage()));
log.severe(stringManager.getString("upgrade.transform.startFailureCheckAccessMessage"));
//ex.printStackTrace();
return false;
}
return true;