Package org.springframework.oxm

Examples of org.springframework.oxm.MarshallingFailureException


      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()) + "]", ex);
    }
  }
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

  @Test
  public void writeWithMarshallingFailureException() throws Exception {
    String body = "<root>Hello World</root>";
    MockHttpOutputMessage outputMessage = new MockHttpOutputMessage();
    MarshallingFailureException ex = new MarshallingFailureException("forced");

    Marshaller marshaller = mock(Marshaller.class);
    willThrow(ex).given(marshaller).marshal(eq(body), isA(Result.class));

    try {
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.