Brahma,

As explained before, you have to configure another marshaler. Your <sm:activationSpecs/> should look something like this:

<sm:activationSpecs>

<!-- Look for files in the source directory -->
<sm:activationSpec componentName="filePoller" service="pollfile:filePoller" destinationService="pollfile:fileSender">
<sm:component>
<bean class="org.apache.servicemix.components.file.FilePoller">
<property name="file" value="D:/MySQLTest" />
<property name="period" value="5000" />
<property name="deleteFile" value="false" />
<property name="filter" ref="rfilter" />
<property name="marshaler">
<bean class="org.apache.servicemix.components.util.SimpleFlatFileMarshaler"/>
</property>
</bean>
</sm:component>
</sm:activationSpec>

<!-- Write files to the destination directory -->
<sm:activationSpec componentName="fileSender" service="pollfile:fileSender">
<sm:component>
<bean class="org.apache.servicemix.components.file.FileWriter">
<property name="directory" value="D:/dest" />
<property name="marshaler">
<bean class="org.apache.servicemix.components.util.SimpleFlatFileMarshaler"/>
</property>
</bean>
</sm:component>
</sm:activationSpec>

</sm:activationSpecs>


Be sure to download a more recent version of ServiceMix first because 3.1 doesn't have the required SimpleFlatFileMarshaler.

Gert

[EMAIL PROTECTED] wrote:

Hi Gert,

I am copying file from source to destination using filepoller and filesender components. But it’s copying file from source with zero bytes.How to resolve this problem.

My servicemix.xml file is:

*<?xml version=”1.0” encoding=”UTF-8”?>*

*<beans xmlns:sm="http://servicemix.apache.org/config/1.0"*

* xmlns:pollfile="http://pollfile.cts.com/pollFile";>*

* <classpath>*

* <location>.</location>*

* <location>lib/servicemix-components-3.1-incubating.jar</location>*

* <location>lib/servicemix-core-3.1-incubating.jar</location>*

* <location>lib/oro-2.0.8.jar</location>*

*</classpath>*

* *

* <sm:serviceunit id="jbi">*

* <sm:activationSpecs>*

* <!-- Look for files in the source directory -->*

* <sm:activationSpec componentName="filePoller" service="pollfile:filePoller" destinationService="pollfile:fileSender">*

* <sm:component>*

* <bean class="org.apache.servicemix.components.file.FilePoller">*

* <property name="file" value="D:/MySQLTest" />*

* <property name="period" value="5000" />*

* <property name="deleteFile" value="false" />*

* <property name="filter" ref="rfilter" />*

* </bean>*

* </sm:component>*

* </sm:activationSpec>*

* *

* <!-- Write files to the destination directory -->*

* <sm:activationSpec componentName="fileSender" service="pollfile:fileSender">*

* <sm:component>*

* <bean class="org.apache.servicemix.components.file.FileWriter">*

* <property name="directory" value="D:/dest" />*

* <property name="marshaler">*

* <bean class="org.apache.servicemix.components.util.DefaultFileMarshaler">*

* <property name="fileName">*

* <bean class="org.apache.servicemix.expression.JaxenStringXPathExpression">*

* <constructor-arg value="concat('sample_',/test/@id, '.txt')" />*

* </bean>*

* </property> *

* </bean>*

* </property>*

* </bean>*

* </sm:component>*

* </sm:activationSpec>*

* </sm:activationSpecs>*

* </sm:serviceunit>*

* <bean id="rfilter" class="org.apache.oro.io.GlobFilenameFilter">*

* <constructor-arg value="*.txt"/> *

* </bean>*

* </beans>*

* *

* *

* *

* *

The following error is getting logged in server log.

2007-06-12 11:17:50,971 DEBUG [org.apache.servicemix.jbi.messaging.DeliveryChannelImpl] Notifying exchange ID:PCIIB09816-2731-1181627143581-10:0(671416) in DeliveryChannel{filePoller} from processInboundSynchronousExchange

2007-06-12 11:17:50,971 DEBUG [org.apache.servicemix.jbi.messaging.DeliveryChannelImpl] Notified: ID:PCIIB09816-2731-1181627143581-10:0(671416) in DeliveryChannel{filePoller} from sendSync

2007-06-12 11:17:55,721 DEBUG [org.apache.servicemix.components.file.FilePoller] Polling directory D:\MySQLTest

2007-06-12 11:17:55,721 DEBUG [org.apache.servicemix.components.file.FilePoller] Scheduling file D:\MySQLTest\mysqltest.txt for processing

2007-06-12 11:17:55,721 DEBUG [org.apache.servicemix.components.file.FilePoller] Processing file D:\MySQLTest\mysqltest.txt

2007-06-12 11:17:55,721 DEBUG [org.apache.servicemix.jbi.messaging.DeliveryChannelImpl] SendSync ID:PCIIB09816-2731-1181627143581-10:1 in DeliveryChannel{filePoller}

*2007-06-12 11:17:55,721 DEBUG [org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow] Called Flow send*

*2007-06-12 11:17:55,721 DEBUG [org.apache.servicemix.jbi.messaging.DeliveryChannelImpl] Waiting for exchange ID:PCIIB09816-2731-1181627143581-10:1 (1b7d13e) to be answered in DeliveryChannel{filePoller} from sendSync*

*2007-06-12 11:17:55,721 ERROR [STDERR] [Fatal Error] mysqltest.txt:1:1: Content is not allowed in prolog.*

*2007-06-12 11:17:55,721 DEBUG [org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue]* [EMAIL PROTECTED] dequeued exchange: InOnly[*

* id: ID:PCIIB09816-2731-1181627143581-10:1*

* status: Active*

* role: provider*

* service: {http://pollfile.cts.com/pollFile}fileSender*

* endpoint: fileSender*

* in: Unable to display: org.xml.sax.SAXParseException: Content is not allowed in prolog.*

]

*2007-06-12 11:17:55,721 DEBUG [org.apache.servicemix.components.util.OutBinding] Exchange failed*

*javax.jbi.messaging.MessagingException: java.io.IOException: Stream closed*

at org.apache.servicemix.expression.JaxenXPathExpression.evaluate(JaxenXPathExpression.java:105)

at org.apache.servicemix.components.util.DefaultFileMarshaler.getOutputName(DefaultFileMarshaler.java:65)

at org.apache.servicemix.components.file.FileWriter.process(FileWriter.java:111)

at org.apache.servicemix.components.util.OutBinding.onMessageExchange(OutBinding.java:49)

at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:593)

at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)

at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)

at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)

at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)

at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)

at java.lang.Thread.run(Thread.java:595)

*Caused by: java.io.IOException: Stream closed*

at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)

at java.io.BufferedInputStream.read(BufferedInputStream.java:239)

at org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.read(Unknown Source)

at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)

at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

at org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(SourceTransformer.java:230)

at org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(SourceTransformer.java:135)

at org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:289)

at org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:306)

at org.apache.servicemix.expression.JaxenXPathExpression.getXMLNode(JaxenXPathExpression.java:209)

at org.apache.servicemix.expression.JaxenXPathExpression.evaluate(JaxenXPathExpression.java:85)

... 10 more

Please help.

Thanks&Regards

Brahma Naidu

This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.


Reply via email to