Package org.springframework.oxm

Examples of org.springframework.oxm.MarshallingFailureException


    try {
      Transformer transformer = transformerFactory.newTransformer();
      result = new DOMResult();
      transformer.transform(source, result);
    } catch (Exception e) {
      throw new MarshallingFailureException("Failed to unmarshal SOAP Response", e);
    }
    Weather weather = new Weather();
    String expression = xpathPrefix + "p:City";
    String city = XPathExpressionFactory.createXPathExpression(expression, namespacePrefixes).evaluateAsString(result.getNode());
    weather.setCity(city);
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()) + "]");
    }

  }
View Full Code Here

      transformer.transform(source, new StreamResult(os));
      ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
      return unmarshalInputStream(is);
    }
    catch (TransformerException ex) {
      throw new MarshallingFailureException(
          "Could not transform from [" + ClassUtils.getShortName(source.getClass()) + "]");
    }
  }
View Full Code Here

    if (ex instanceof ValidationException) {
      return new ValidationFailureException("JiBX validation exception", ex);
    }
    else {
      if (marshalling) {
        return new MarshallingFailureException("JiBX marshalling exception", ex);
      }
      else {
        return new UnmarshallingFailureException("JiBX 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

   */
  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

   */
  public static 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

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.