Example usage for org.springframework.oxm MarshallingFailureException MarshallingFailureException

List of usage examples for org.springframework.oxm MarshallingFailureException MarshallingFailureException

Introduction

In this page you can find the example usage for org.springframework.oxm MarshallingFailureException MarshallingFailureException.

Prototype

public MarshallingFailureException(String msg) 

Source Link

Document

Construct a MarshallingFailureException with the specified detail message.

Usage

From source file:org.dataone.proto.trove.mn.rest.exceptions.DataOneExceptionMarshaller.java

@Override
public void marshal(Object o, Result result) throws IOException, XmlMappingException {
    BaseException baseException = (BaseException) o;

    ByteArrayInputStream is = new ByteArrayInputStream(
            baseException.serialize(BaseException.FMT_XML).getBytes());

    try {/*w  ww.  j  a  va2  s . c o  m*/
        Transformer transformer = transformerFactory.newTransformer();
        transformer.transform(new StreamSource(is), result);
    } catch (TransformerException ex) {
        throw new MarshallingFailureException("DataOneExceptionMarshaller: " + ex.getMessage());
    }
}