Fix the TypeConverter issue

  This PR should fix the TypeConverter issue reported as http://jira.codehaus.org/browse/MILYN-655 (update)
Yes, this was necessary, as otherwise no matching type-converter could 
be found, see error below:

2014-08-06 17:10:00,418 [main           ] ERROR 
DefaultErrorHandler            - Failed delivery for (MessageId: 
ID-jcordes-csb-38938-1407337795969-11-1 on ExchangeId: 
ID-jcordes-csb-38938-1407337795969-11-2). Exhausted after delivery 
attempt: 1 caught: org.apache.camel.NoTypeConversionAvailableException: 
No type converter available to convert from type: 
org.milyn.smooks.camel.dataformat.Customer to the required type: 
javax.xml.transform.Source with value [John, Cocktolstol, Male, 35, USA]
org.apache.camel.NoTypeConversionAvailableException: No type converter 
available to convert from type: 
org.milyn.smooks.camel.dataformat.Customer to the required type: 
javax.xml.transform.Source with value [John, Cocktolstol, Male, 35, USA]
         at 
org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:169)
         at 
org.milyn.smooks.camel.dataformat.SmooksDataFormat.marshal(SmooksDataFormat.java:83)

IMO this is the right conversion as the result from the unmarshal inside 
the test 
(test/java/org/milyn/smooks/camel/dataformat/SmooksDataFormatTest.java, 
unmarshalMarshalThroughCamel) is a specific object which can't be 
translated into javax.xml.transform.Source.

On 08/06/2014 01:14 PM, Tom Fennelly wrote:
>
> In 
> smooks-cartridges/camel/src/main/java/org/milyn/smooks/camel/dataformat/SmooksDataFormat.java:
>
> > @@ -78,7 +78,7 @@ public SmooksDataFormat(final String smooksConfig) throws Exception {
> >      public void marshal(final Exchange exchange, final Object fromBody, final OutputStream toStream) throws Exception {
> >          final ExecutionContext execContext = smooks.createExecutionContext();
> >          final TypeConverter typeConverter = exchange.getContext().getTypeConverter();
> > -        final Source source = typeConverter.mandatoryConvertTo(Source.class, exchange, fromBody);
> > +        final JavaSource source = typeConverter.mandatoryConvertTo(JavaSource.class, exchange, fromBody);
>
> Did you need to change this from the generic Source type to JavaSource?
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/smooks/smooks/pull/80/files#r15867630>.
>


-- 

-- 


Beste Grüße/Kind regards


*Jochen Cordes*
Senior Consultant

Red Hat GmbH
MesseTurm, Friedrich-Ebert-Anlage 49, 60308 Frankfurt am Main

Mobile: +49 (0) 173 6609271
E-Mail: jcordes@redhat.com, http://www.redhat.de/

Delivering value year after year
Red Hat ranks # 1 in value among software vendors
http://www.redhat.com/promo/vendor/

Freedom...Courage...Commitment...Accountability

<http://www.redhat-forum.com>
________________________________________________________________________
Red Hat GmbH, http://www.de.redhat.com/ Sitz: Grasbrunn,
Handelsregister: Amtsgericht München, HRB 153243
Geschäftsführer: Charles Cachera, Michael Cunningham, Michael O'Neill, 
Charles Peters