This looks like a minor bug in the out-of-the-box type converters in Camel...

https://issues.apache.org/activemq/browse/CAMEL-624

I've just applied a patch so this will be fixed in 1.4.0. In the
meantime you can add a processor to fix this...

from(...).process(
  new Processor() {
     public void process(Exchange exchange) {
        StreamSource source = exchange.getIn().getBody(StreamSource.class);
        if (source != null) {
            in.setBody(source.getInputStream());
        }
    }
}).
to(...)

2008/6/20 skg <[EMAIL PROTECTED]>:
>
> Hi,
> I am getting some error i am working on the third example given on tutorial
> and i replace the code in the tutorial with
> from("jbi:endpoint:urn:org:apache:servicemix:tutorial:camel:jms:consumer").to("file:C:/MavenCheckSender/reports.txt");
> but i am not getting any output in it and in service mix it is showing
>       at java.lang.Thread.run(Thread.java:595)
> ERROR - DeadLetterChannel              - On delivery attempt: 1 caught:
> org.apac
> e.camel.InvalidPayloadException: No in body available of type:
> java.io.InputStr
> am but has value: StringSource[<?xml version="1.0"
> encoding="UTF-8"?><message>H
> llo saurabh!</message>] of type: org.apache.servicemix.jbi.jaxp.StringSource
> on
> the exchange: Exchange[FileMessage: C:\MavenCheckSender\reports.txt]
> rg.apache.camel.InvalidPayloadException: No in body available of type:
> java.io.
> nputStream but has value: StringSource[<?xml version="1.0"
> encoding="UTF-8"?><m
> ssage>Hello saurabh!</message>] of type:
> org.apache.servicemix.jbi.jaxp.StringS
> urce on the exchange: Exchange[FileMessage: C:\MavenCheckSender\reports.txt]
>       at
> org.apache.camel.util.ExchangeHelper.getMandatoryInBody(ExchangeHelpe
> .java:117)
>       at
> org.apache.camel.component.file.FileProducer.process(FileProducer.jav
> :71)
>       at
> org.apache.camel.component.file.FileProducer.process(FileProducer.jav
> :60)
>       at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$Processor
> oAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
>       at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:7
> )
>       at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChanne
> .java:136)
>       at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChanne
> .java:86)
>       at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
> ssor.java:40)
>       at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
> r.java:44)
>       at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
> cProcessor.java:68)
>       at
> org.apache.servicemix.camel.CamelJbiEndpoint.processInOnly(CamelJbiEn
> point.java:64)
>       at
> org.apache.servicemix.common.endpoints.ProviderEndpoint.process(Provi
> erEndpoint.java:100)
>       at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
> eCycle.java:538)
>       at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
> aseLifeCycle.java:490)
>       at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
> ycle.java:46)
>       at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
> (DeliveryChannelImpl.java:610)
>       at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
> .java:172)
>       at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
> va:167)
>       at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
> :134)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
> tor.java:650)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> java:675)
>       at java.lang.Thread.run(Thread.java:595)
>
>
> James.Strachan wrote:
>>
>> 2008/6/20 skg <[EMAIL PROTECTED]>:
>>>
>>> Hi,
>>>
>>> I worked with the example which uses jms to receive and send message to
>>> web
>>> services. The consumer receives the message on servicemix console but
>>> what
>>> if I want the message in some file or some simple java objects such as
>>> hashmap. Can we store our message in that also.
>>
>> Reply soon
>>
>> So send to a file use the file endpoint...
>> http://activemq.apache.org/camel/file.html
>>
>> e.g.
>>
>> from("activemq:SomeQueue").to("file://someDir");
>>
>> To work with beans and hashmaps, just send the message to a bean...
>> http://activemq.apache.org/camel/bean-integration.html
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://open.iona.com
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/working-with-jms-tp18026353s22882p18026676.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to