Examples of CannotConvertBetweenTypesException


Examples of org.axonframework.serializer.CannotConvertBetweenTypesException

    @Override
    public byte[] convert(InputStream original) {
        try {
            return bytesFrom(original);
        } catch (IOException e) {
            throw new CannotConvertBetweenTypesException("Unable to convert InputStream to byte[]. "
                                                                 + "Error while reading from Stream.", e);
        }
    }
View Full Code Here

Examples of org.axonframework.serializer.CannotConvertBetweenTypesException

    @Override
    public InputStream convert(Blob original) {
        try {
            return original.getBinaryStream();
        } catch (SQLException e) {
            throw new CannotConvertBetweenTypesException("Error while attempting to read data from Blob", e);
        }
    }
View Full Code Here

Examples of org.axonframework.serializer.CannotConvertBetweenTypesException

    @Override
    public JsonNode convert(byte[] original) {
        try {
            return objectMapper.readTree(original);
        } catch (IOException e) {
            throw new CannotConvertBetweenTypesException("An error occurred while converting a JsonNode to byte[]", e);
        }
    }
View Full Code Here

Examples of org.axonframework.serializer.CannotConvertBetweenTypesException

    @Override
    public byte[] convert(JsonNode original) {
        try {
            return objectMapper.writeValueAsBytes(original);
        } catch (JsonProcessingException e) {
            throw new CannotConvertBetweenTypesException("An error occurred while converting a JsonNode to byte[]", e);
        }
    }
View Full Code Here

Examples of org.axonframework.serializer.CannotConvertBetweenTypesException

    public Document convert(InputStream original) {
        try {
            return new STAXEventReader().readDocument(new InputStreamReader(original,
                                                                            Charset.forName("UTF-8")));
        } catch (XMLStreamException e) {
            throw new CannotConvertBetweenTypesException("Cannot convert from InputStream to dom4j Document.", e);
        }
    }
View Full Code Here

Examples of org.axonframework.serializer.CannotConvertBetweenTypesException

    @Override
    public Document convert(InputStream original) {
        try {
            return new Builder().build(new InputStreamReader(original));
        } catch (ParsingException e) {
            throw new CannotConvertBetweenTypesException("Cannot convert from InputStream to XOM Document.", e);
        } catch (IOException e) {
            throw new CannotConvertBetweenTypesException("Cannot convert from InputStream to XOM Document.", e);
        }

    }
View Full Code Here

Examples of org.axonframework.serializer.CannotConvertBetweenTypesException

    @Test
    public void testUpcastObject_UnavailableTypeConversion() {
        Upcaster mockUpcaster12 = new StubUpcaster(intermediate1.getType(), intermediate2, Document.class);
        ConverterFactory mockConverterFactory = mock(ConverterFactory.class);
        CannotConvertBetweenTypesException mockException = new CannotConvertBetweenTypesException("Mock");
        when(mockConverterFactory.getConverter(isA(Class.class), isA(Class.class))).thenThrow(
                mockException);

        UpcasterChain chain = createUpcasterChain(mockConverterFactory, mockUpcaster12);
        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.