L.S.,
Continuing this on the users mailing list...
First of all, I would recommend you to use the new JBI component
(servicemix-file) for polling and sending files. Look at
http://incubator.apache.org/servicemix/servicemix-file.html for more
information on that one.
For the lightweight example you have here:
- You should make the file attribute in the poller refer to a directory
instead of a file.
- If you want to transfer something other than XML files, you should be
using a Marshaler to do so (e.g. ServiceMix's SimpleFlatFileMarshaler or
one you build yourself)
Regards,
Gert
[EMAIL PROTECTED] wrote:
Hi Gert,
Could you please help me in servicemix-lwcontainer?
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 error.
My servicemix.xml looks like this:
<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/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/mysqltest.txt" />
<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.jbi.JaxenStringXPathExpression">*
* <constructor-arg value="concat('sample_', /sample/@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>
I commented some portion in the destination part with that it’s
copying file from source to destination with 0 bytes.
Could you please help me in this problem?
How to copy exact file form source directory to destination directory?
*Thanks&Regards*
*Bramha Naidu Aelem*
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.