Example usage for javax.xml.stream FactoryConfigurationError getException

List of usage examples for javax.xml.stream FactoryConfigurationError getException

Introduction

In this page you can find the example usage for javax.xml.stream FactoryConfigurationError getException.

Prototype

public Exception getException() 

Source Link

Document

Return the nested exception (if any)

Usage

From source file:edu.harvard.i2b2.fr.delegate.pm.PMServiceDriver.java

/**
 * Function to convert pm requestVdo to OMElement
 * //from   www  .j av a2  s  .c o  m
 * @param requestPm   String request to send to pm web service
 * @return An OMElement containing the pm web service requestVdo
 */
public OMElement getPmPayLoad(String requestPm) throws I2B2Exception {
    OMElement method = null;
    try {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        //OMNamespace omNs = fac.createOMNamespace("http://www.i2b2.org/xsd/hive/msg",
        //"i2b2");
        //method = fac.createOMElement("request", omNs);
        StringReader strReader = new StringReader(requestPm);
        XMLInputFactory xif = XMLInputFactory.newInstance();
        XMLStreamReader reader = xif.createXMLStreamReader(strReader);
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        method = builder.getDocumentElement();

    } catch (FactoryConfigurationError e) {
        log.error(e.getMessage());
        throw new I2B2Exception("", e.getException());
    } catch (XMLStreamException e) {
        log.error(e.getMessage());
        throw new I2B2Exception("", e);
    }
    return method;
}

From source file:edu.harvard.i2b2.crc.loader.delegate.pm.PMServiceDriver.java

/**
 * Function to convert pm requestVdo to OMElement
 * /*from   www.j av a  2 s  . co m*/
 * @param requestPm
 *            String request to send to pm web service
 * @return An OMElement containing the pm web service requestVdo
 */
public OMElement getPmPayLoad(String requestPm) throws I2B2Exception {
    OMElement method = null;
    try {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        // OMNamespace omNs =
        // fac.createOMNamespace("http://www.i2b2.org/xsd/hive/msg",
        // "i2b2");
        // method = fac.createOMElement("request", omNs);
        StringReader strReader = new StringReader(requestPm);
        XMLInputFactory xif = XMLInputFactory.newInstance();
        XMLStreamReader reader = xif.createXMLStreamReader(strReader);
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        method = builder.getDocumentElement();

    } catch (FactoryConfigurationError e) {
        log.error(e.getMessage());
        throw new I2B2Exception("", e.getException());
    } catch (XMLStreamException e) {
        log.error(e.getMessage());
        throw new I2B2Exception("", e);
    }
    return method;
}