logger.fatal("failed to read/parse pipe advertisement");
logger.fatal("failed to read or parse pipe advertisement");
    private void createInputPipe() {        // first we try loading an existing pipe advertisement from file        File advFile = new File(PIPE_ADV_FILE);        if (!advFile.exists()) {            // we need to create a new pipe advertisement            inputPipeAdv = (PipeAdvertisement)                    AdvertisementFactory.newAdvertisement(PipeAdvertisement.getAdvertisementType());            inputPipeAdv.setName("DiscusP2PClient");            inputPipeAdv.setType(PipeService.UnicastType);            inputPipeAdv.setPipeID(IDFactory.newPipeID(netPeerGroup.getPeerGroupID()));            logger.debug("created a new pipe with id " + inputPipeAdv.getID());            // save this advertisement to use it next time            try {                FileOutputStream fout = new FileOutputStream(advFile);                BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fout));                StructuredTextDocument doc = (StructuredTextDocument) inputPipeAdv.getDocument(xmlMimeMediaType);                doc.sendToWriter(out);                out.flush();                out.close();            } catch (IOException e) {                logger.error("Could not save pipe ad: " + e);            }            logger.debug("saved new pipe advertisment");        } else {            logger.debug("reading in pipe advertisement file");            try {                FileInputStream is = new FileInputStream(advFile);                inputPipeAdv = (PipeAdvertisement)                        AdvertisementFactory.newAdvertisement(xmlMimeMediaType, is);                is.close();            } catch (Exception e) {                logger.fatal("failed to read/parse pipe advertisement");                return;            }        }        try {            pipeService.createInputPipe(inputPipeAdv, this);        } catch (IOException e) {            logger.error("could not create input pipe!: " + e);        }        // create XML representation for sending        org.w3c.dom.Document doc = db.newDocument();        inputPipeXMLAd = doc.createElement(Server.PIPE_TAG);        inputPipeXMLAd.setAttribute("xmlns:jxta", "http://jxta.org");        Element id = doc.createElement("Id");        id.appendChild(doc.createTextNode(inputPipeAdv.getID().toString()));        inputPipeXMLAd.appendChild(id);        Element type = doc.createElement("Type");        type.appendChild(doc.createTextNode(inputPipeAdv.getType()));        inputPipeXMLAd.appendChild(type);        Element name = doc.createElement("Name");        name.appendChild(doc.createTextNode(inputPipeAdv.getName()));        inputPipeXMLAd.appendChild(name);    }