DocumentBuilder db = null;
DocumentBuilder db;
    public void initDone() throws FactoryException {        reload = getProperties().getProperty("reload", "false").equals("true");        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();        InputStream is = null;        String name = getProperties().getProperty("resource", "workflows.xml");        if ((name != null) && (name.indexOf(":/") > -1)) {            try {                is = new URL(name).openStream();            } catch (Exception e) {            }        }        if (is == null) {            try {                is = classLoader.getResourceAsStream(name);            } catch (Exception e) {            }        }        if (is == null) {            try {                is = classLoader.getResourceAsStream("/" + name);            } catch (Exception e) {            }        }        if (is == null) {            try {                is = classLoader.getResourceAsStream("META-INF/" + name);            } catch (Exception e) {            }        }        if (is == null) {            try {                is = classLoader.getResourceAsStream("/META-INF/" + name);            } catch (Exception e) {            }        }        try {            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();            dbf.setNamespaceAware(true);            DocumentBuilder db = null;            try {                db = dbf.newDocumentBuilder();            } catch (ParserConfigurationException e) {                throw new FactoryException("Error creating document builder", e);            }            Document doc = db.parse(is);            Element root = (Element) doc.getElementsByTagName("workflows").item(0);            workflows = new HashMap();            List list = XMLUtil.getChildElements(root, "workflow");            for (int i = 0; i < list.size(); i++) {                Element e = (Element) list.get(i);                WorkflowConfig config = new WorkflowConfig(e.getAttribute("type"), e.getAttribute("location"));                workflows.put(e.getAttribute("name"), config);            }        } catch (Exception e) {            throw new InvalidWorkflowDescriptorException("Error in workflow config", e);        }    }