Example usage for javax.xml.parsers ParserConfigurationException printStackTrace

List of usage examples for javax.xml.parsers ParserConfigurationException printStackTrace

Introduction

In this page you can find the example usage for javax.xml.parsers ParserConfigurationException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:de.ingrid.iplug.dscmapclient.index.mapper.ScriptedWmsDocumentMapper.java

public ScriptedWmsDocumentMapper() {
    dbf = DocumentBuilderFactory.newInstance();
    try {//from www.j a  va2 s .  co  m
        docBuilder = dbf.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
        log.error("Error instantiating class.", e);
        e.printStackTrace();
    }
}

From source file:com.phildatoon.weather.WOEIDUtils.java

private Document convertStringToDocument(Context context, String src) {
    MyLog.d("convert string to document");
    Document dest = null;/*from w  w w  .  j  a v a 2s.  co  m*/

    DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder parser;

    try {
        parser = dbFactory.newDocumentBuilder();
        dest = parser.parse(new ByteArrayInputStream(src.getBytes()));
    } catch (ParserConfigurationException e1) {
        e1.printStackTrace();
        Toast.makeText(context, e1.toString(), Toast.LENGTH_LONG).show();
    } catch (SAXException e) {
        e.printStackTrace();
        Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
    } catch (IOException e) {
        e.printStackTrace();
        Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
    }

    return dest;
}

From source file:de.ingrid.iplug.dscmapclient.index.mapper.ScriptedIdfDocumentMapper.java

public ScriptedIdfDocumentMapper() {
    dbf = DocumentBuilderFactory.newInstance();
    try {/*  w w w.  jav a 2 s.c o  m*/
        docBuilder = dbf.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
        log.error("Error instantiating class.", e);
        e.printStackTrace();
    }
}

From source file:util.ReadXml.java

public ReadXml(String xmlFile, String beanFile) {
    this.xmlFile = xmlFile;

    //BeanFactory
    resource = new FileSystemResource(beanFile);
    factory = new XmlBeanFactory(resource);

    //DOMparser factory
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    try {//w  ww. j  av a  2  s  .  co m

        //Using factory get an instance of document builder
        DocumentBuilder db = dbf.newDocumentBuilder();

        //parse using builder to get DOM representation of the XML file
        dom = db.parse(xmlFile);
    } catch (ParserConfigurationException pce) {
        pce.printStackTrace();
    } catch (SAXException se) {
        se.printStackTrace();
    } catch (IOException ioe) {
        ioe.printStackTrace();
    }

    //get the root elememt
    docEle = dom.getDocumentElement();

}

From source file:ali.arshad.soomro.aonawaredistservicesdk.AonawareDictServiceUtils.java

private Document convertWordDefinationToDocument(Context context, String defSource)
        throws org.xml.sax.SAXParseException {
    Document destDocument = null;

    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder documentBuilder = null;

    try {//from   w  w  w  . ja  v  a2  s.  c o m
        documentBuilder = factory.newDocumentBuilder();
        destDocument = documentBuilder.parse(new ByteArrayInputStream(defSource.getBytes()));
        return destDocument;
    } catch (ParserConfigurationException e) {
        e.printStackTrace();
        return null;
    } catch (SAXException e) {
        e.printStackTrace();
        return null;
    } catch (IOException e) {
        e.printStackTrace();
        return null;
    } catch (Exception e) {
        return null;
    }
}

From source file:com.example.apis.ifashion.WOEIDUtils.java

private Document convertStringToDocument(Context context, String src) {
    YahooWeatherLog.d("convert string to document");
    Document dest = null;/*www .  j  a  va 2 s. c  om*/

    DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder parser;

    try {
        parser = dbFactory.newDocumentBuilder();
        dest = parser.parse(new ByteArrayInputStream(src.getBytes()));
    } catch (ParserConfigurationException e1) {
        e1.printStackTrace();
        Toast.makeText(context, e1.toString(), Toast.LENGTH_LONG).show();
    } catch (SAXException e) {
        e.printStackTrace();
        Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
    } catch (IOException e) {
        e.printStackTrace();
        Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
    }

    return dest;

}

From source file:info.androidhive.androidsplashscreentimer.WOEIDUtils.java

private Document convertStringToDocument(Context context, String src) {
    MyLog.d("convert string to document");
    Document dest = null;//from w  w w.  j a  v  a 2 s .c om

    DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder parser;

    try {
        parser = dbFactory.newDocumentBuilder();
        dest = parser.parse(new ByteArrayInputStream(src.getBytes()));
    } catch (ParserConfigurationException e1) {
        e1.printStackTrace();
        Toast.makeText(context, e1.toString(), Toast.LENGTH_LONG).show();
    } catch (SAXException e) {
        e.printStackTrace();
        Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
    } catch (IOException e) {
        e.printStackTrace();
        Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
    }

    return dest;

}

From source file:eu.impact_project.wsclient.XmlServiceProvider.java

private Document convertToDoc(InputStream xmlFile) {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);/*  w w w  .j  ava2  s  .  co m*/
    DocumentBuilder builder;
    Document doc = null;
    try {
        builder = factory.newDocumentBuilder();
        doc = builder.parse(xmlFile);
    } catch (ParserConfigurationException e) {
        e.printStackTrace();
    } catch (SAXException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return doc;
}

From source file:XMLWriteTest.java

public RectangleComponent() {
    rects = new ArrayList<Rectangle2D>();
    colors = new ArrayList<Color>();
    generator = new Random();

    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    try {//  w  w w . j  a v  a  2  s  . c  om
        builder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
        e.printStackTrace();
    }
}

From source file:eu.planets_project.pp.plato.services.action.planets.PlanetsMigrationService.java

private QName determineServiceQNameFromWsdl(URL wsdlLocation) {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

    // Using factory get an instance of document builder
    DocumentBuilder db;/*from   w ww.  j  a v a 2s .  com*/
    try {
        db = dbf.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
        e.printStackTrace();
        return null;
    }

    // parse using builder to get DOM representation of the XML file
    Document dom;
    try {
        dom = db.parse(wsdlLocation.openStream());
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }

    // get the root elememt
    Element root = dom.getDocumentElement();
    return new QName(root.getAttribute("targetNamespace"), root.getAttribute("name"));
}