You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Richa Khurana <ri...@globallogic.com> on 2008/09/05 13:49:11 UTC
Unable to read files in my xbean
Hi,
I am a newbie to servicemix and camel.. am using a filepoller to load
files from a source folder and send them to a JMS queue and then to my
xbean. it reaches upto my xbean but i cant read the file, it throws the
below exception
DEBUG - SedaQueue -
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1661f7b dequeued
exchange: InOnly[
id: ID:172.16.80.75-11c324d629e-8:0
status: Active
role: provider
endpoint: myBean
in: Unable to display: java.io.IOException: Stream closed
Thanks,
Richa
RE: Unable to read files in my xbean
Posted by Richa Khurana <ri...@globallogic.com>.
Here are the configurations-
File poller-
<beans xmlns:file="http://servicemix.apache.org/file/1.0"
xmlns:tutorial="urn:org:apache:servicemix:tutorial:camel"
xmlns:tut="urn:servicemix:tutorial">
<!-- add the sender endpoint here -->
<file:sender service="tut:file"
endpoint="sender"
directory="C:\Temp" >
</file:sender>
<!-- add the poller endpoint here -->
<file:poller service="tut:file"
endpoint="poller"
file="C:\Test"
targetService="tutorial:jms">
<property name="filter">
<bean class="org.apache.commons.io.filefilter.WildcardFilter">
<constructor-arg value="*.pdf" />
</bean>
</property>
</file:poller>
</beans>
JMS:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
xmlns:tutorial="urn:org:apache:servicemix:tutorial:camel"
xmlns:amq="http://activemq.org/config/1.0">
<jms:provider service="tutorial:jms"
endpoint="provider"
destinationName="tutorial.camel.queue"
connectionFactory="#connectionFactory" />
<jms:consumer service="tutorial:jms"
endpoint="consumer"
destinationName="tutorial.camel.queue"
connectionFactory="#connectionFactory"
targetService="tutorial:jms"
targetEndpoint="consumer" />
<amq:connectionFactory id="connectionFactory"
brokerURL="tcp://localhost:61616" />
</beans>
Xbean:
<beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
xmlns:uploadWS="urn:servicemix:tutorial">
<bean:endpoint service="uploadWS:myBean" endpoint="myBean"
bean="#myBean"/>
<bean id="myBean" class="com.thirdpillar.uploadWS.abc"/>
</beans>
-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com]
Sent: Friday, September 05, 2008 5:22 PM
To: users@servicemix.apache.org
Subject: Re: Unable to read files in my xbean
Could you please provide the xbean configurations and the code of your
custom bean ?
On Fri, Sep 5, 2008 at 1:49 PM, Richa Khurana
<ri...@globallogic.com> wrote:
> Hi,
>
> I am a newbie to servicemix and camel.. am using a filepoller to load
> files from a source folder and send them to a JMS queue and then to my
> xbean. it reaches upto my xbean but i cant read the file, it throws
the
> below exception
>
>
>
> DEBUG - SedaQueue -
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1661f7b dequeued
> exchange: InOnly[
> id: ID:172.16.80.75-11c324d629e-8:0
> status: Active
> role: provider
> endpoint: myBean
> in: Unable to display: java.io.IOException: Stream closed
>
> Thanks,
> Richa
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
Re: Unable to read files in my xbean
Posted by Guillaume Nodet <gn...@gmail.com>.
Could you please provide the xbean configurations and the code of your
custom bean ?
On Fri, Sep 5, 2008 at 1:49 PM, Richa Khurana
<ri...@globallogic.com> wrote:
> Hi,
>
> I am a newbie to servicemix and camel.. am using a filepoller to load
> files from a source folder and send them to a JMS queue and then to my
> xbean. it reaches upto my xbean but i cant read the file, it throws the
> below exception
>
>
>
> DEBUG - SedaQueue -
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1661f7b dequeued
> exchange: InOnly[
> id: ID:172.16.80.75-11c324d629e-8:0
> status: Active
> role: provider
> endpoint: myBean
> in: Unable to display: java.io.IOException: Stream closed
>
> Thanks,
> Richa
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
Re: Unable to read files in my xbean
Posted by Guillaume Nodet <gn...@gmail.com>.
Yes, this is expected. You can retrieve the binary stream in the
attachments on the input normalized message.
On Fri, Sep 5, 2008 at 2:15 PM, Richa Khurana
<ri...@globallogic.com> wrote:
> I tried that also. But, then the source object on xbean side was null.
>
> -----Original Message-----
> From: Guillaume Nodet [mailto:gnodet@gmail.com]
> Sent: Friday, September 05, 2008 5:43 PM
> To: users@servicemix.apache.org
> Subject: Re: Unable to read files in my xbean
>
> I think the reason is that servicemix expects an xml as the content.
> You need to set up the file endpoint to use the BinaryFileMarshaler.
>
> On Fri, Sep 5, 2008 at 1:49 PM, Richa Khurana
> <ri...@globallogic.com> wrote:
>> Hi,
>>
>> I am a newbie to servicemix and camel.. am using a filepoller to load
>> files from a source folder and send them to a JMS queue and then to my
>> xbean. it reaches upto my xbean but i cant read the file, it throws
> the
>> below exception
>>
>>
>>
>> DEBUG - SedaQueue -
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1661f7b dequeued
>> exchange: InOnly[
>> id: ID:172.16.80.75-11c324d629e-8:0
>> status: Active
>> role: provider
>> endpoint: myBean
>> in: Unable to display: java.io.IOException: Stream closed
>>
>> Thanks,
>> Richa
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
RE: Unable to read files in my xbean
Posted by Richa Khurana <ri...@globallogic.com>.
I tried that also. But, then the source object on xbean side was null.
-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com]
Sent: Friday, September 05, 2008 5:43 PM
To: users@servicemix.apache.org
Subject: Re: Unable to read files in my xbean
I think the reason is that servicemix expects an xml as the content.
You need to set up the file endpoint to use the BinaryFileMarshaler.
On Fri, Sep 5, 2008 at 1:49 PM, Richa Khurana
<ri...@globallogic.com> wrote:
> Hi,
>
> I am a newbie to servicemix and camel.. am using a filepoller to load
> files from a source folder and send them to a JMS queue and then to my
> xbean. it reaches upto my xbean but i cant read the file, it throws
the
> below exception
>
>
>
> DEBUG - SedaQueue -
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1661f7b dequeued
> exchange: InOnly[
> id: ID:172.16.80.75-11c324d629e-8:0
> status: Active
> role: provider
> endpoint: myBean
> in: Unable to display: java.io.IOException: Stream closed
>
> Thanks,
> Richa
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
Re: Unable to read files in my xbean
Posted by Guillaume Nodet <gn...@gmail.com>.
I think the reason is that servicemix expects an xml as the content.
You need to set up the file endpoint to use the BinaryFileMarshaler.
On Fri, Sep 5, 2008 at 1:49 PM, Richa Khurana
<ri...@globallogic.com> wrote:
> Hi,
>
> I am a newbie to servicemix and camel.. am using a filepoller to load
> files from a source folder and send them to a JMS queue and then to my
> xbean. it reaches upto my xbean but i cant read the file, it throws the
> below exception
>
>
>
> DEBUG - SedaQueue -
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1661f7b dequeued
> exchange: InOnly[
> id: ID:172.16.80.75-11c324d629e-8:0
> status: Active
> role: provider
> endpoint: myBean
> in: Unable to display: java.io.IOException: Stream closed
>
> Thanks,
> Richa
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
Re: Unable to read files in my xbean
Posted by Lars Heinemann <la...@compart.net>.
Richa,
which FileMarshaler do you use for polling?
That the stream is closed means that it was read before until end of stream.
It can also be caused by having debug log level activated.
Regards
Lars
Am Freitag 05 September 2008 13:49:11 schrieb Richa Khurana:
> Hi,
>
> I am a newbie to servicemix and camel.. am using a filepoller to load
> files from a source folder and send them to a JMS queue and then to my
> xbean. it reaches upto my xbean but i cant read the file, it throws the
> below exception
>
>
>
> DEBUG - SedaQueue -
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1661f7b dequeued
> exchange: InOnly[
> id: ID:172.16.80.75-11c324d629e-8:0
> status: Active
> role: provider
> endpoint: myBean
> in: Unable to display: java.io.IOException: Stream closed
>
> Thanks,
> Richa