Package org.springframework.oxm

Examples of org.springframework.oxm.MarshallingFailureException


    if (ex instanceof XMLStreamValidationException) {
      return new ValidationFailureException("XmlBeans validation exception", ex);
    }
    else if (ex instanceof XmlException || ex instanceof SAXException) {
      if (marshalling) {
        return new MarshallingFailureException("XMLBeans marshalling exception",  ex);
      }
      else {
        return new UnmarshallingFailureException("XMLBeans unmarshalling exception", ex);
      }
    }
View Full Code Here


        ByteArrayOutputStream out = new ByteArrayOutputStream();
       
        try {
            marshaller.marshal(personList, new StreamResult(out));
        } catch (IOException e) {
            throw new MarshallingFailureException(e.getMessage(), e);
        }
       
        logger.debug("Marshalled person list.  '" + out.toString() + "'.");

        assertEquals("Marshalled person list was expected to be '" + MARSHALLER_RESULT + "'.", MARSHALLER_RESULT, out.toString());
View Full Code Here

            ByteArrayOutputStream out = new ByteArrayOutputStream();
           
            try {
                marshaller.marshal(requestPayload, new StreamResult(out));
            } catch (IOException e) {
                throw new MarshallingFailureException(e.getMessage(), e);
            }
           
            post.setRequestEntity(new ByteArrayRequestEntity(out.toByteArray()));
        }
       
View Full Code Here

    if (ex instanceof XMLStreamValidationException) {
      return new ValidationFailureException("XMLBeans validation exception", ex);
    }
    else if (ex instanceof XmlException || ex instanceof SAXException) {
      if (marshalling) {
        return new MarshallingFailureException("XMLBeans marshalling exception",  ex);
      }
      else {
        return new UnmarshallingFailureException("XMLBeans unmarshalling exception", ex);
      }
    }
View Full Code Here

     */
  protected XmlMappingException convertXStreamException(Exception ex, boolean marshalling) {
    if (ex instanceof StreamException || ex instanceof CannotResolveClassException ||
        ex instanceof ConversionException) {
      if (marshalling) {
        return new MarshallingFailureException("XStream marshalling exception",  ex);
      }
      else {
        return new UnmarshallingFailureException("XStream unmarshalling exception", ex);
      }
    }
View Full Code Here

  protected XmlMappingException convertJaxbException(JAXBException ex) {
    if (ex instanceof ValidationException) {
      return new ValidationFailureException("JAXB validation exception", ex);
    }
    else if (ex instanceof MarshalException) {
      return new MarshallingFailureException("JAXB marshalling exception", ex);
    }
    else if (ex instanceof UnmarshalException) {
      return new UnmarshallingFailureException("JAXB unmarshalling exception", ex);
    }
    else {
View Full Code Here

    if (ex instanceof ValidationException) {
      return new ValidationFailureException("Castor validation exception", ex);
    }
    else if (ex instanceof MarshalException) {
      if (marshalling) {
        return new MarshallingFailureException("Castor marshalling exception", ex);
      }
      else {
        return new UnmarshallingFailureException("Castor unmarshalling exception", ex);
      }
    }
View Full Code Here

      // JiBX does not support DOM natively, so we write to a buffer first, and transform that to the Node
      Result result = new DOMResult(node);
      transformAndMarshal(graph, result);
    }
    catch (IOException ex) {
      throw new MarshallingFailureException("JiBX marshalling exception", ex);
    }
  }
View Full Code Here

      SAXResult saxResult = new SAXResult(contentHandler);
      saxResult.setLexicalHandler(lexicalHandler);
      transformAndMarshal(graph, saxResult);
    }
    catch (IOException ex) {
      throw new MarshallingFailureException("JiBX marshalling exception", ex);
    }
  }
View Full Code Here

      ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
      Transformer transformer = this.transformerFactory.newTransformer();
      transformer.transform(new StreamSource(is), result);
    }
    catch (TransformerException ex) {
      throw new MarshallingFailureException(
          "Could not transform to [" + ClassUtils.getShortName(result.getClass()) + "]", ex);
    }

  }
View Full Code Here

TOP

Related Classes of org.springframework.oxm.MarshallingFailureException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.