You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by sou <so...@gmail.com> on 2010/09/08 17:22:03 UTC
moving files
Hi, i'm new user of servicemix.
i'm following the tutorial and it works: i maked a SU that move an xml file
from a directory to another and send a message to jms. But i want to move
other types of files not only xml also i want to make a filer to chosse file
that should be moved by name or extension. I checked the page talking about
servicemix-file and i make my own solution but it don't work and when i
start servicemix there is many errors.So please i need help to change my SU
to mov other types of files and thanks a lot
--
View this message in context: http://servicemix.396122.n5.nabble.com/moving-files-tp2808055p2808055.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
Re: moving files
Posted by sou <so...@gmail.com>.
Finally it works but with some errors, i m afraid that those will makes
problems :
WARN - DefaultBroker - ServiceName
({http://servicemix.apache.org/samples/filemover}fileSender) specified for
routing, but can't fin
d it registered
ERROR - FileComponent - Failed to process file:
c:\servicemix\sender\xbean.xml. Reason:
javax.jbi.messaging.MessagingException: Could
not find route for exchange: InOnly[
id: ID:192.168.1.2-12af3420074-8:1
status: Active
role: provider
service: {http://servicemix.apache.org/samples/filemover}fileSender
in: null
] for service: {http://servicemix.apache.org/samples/filemover}fileSender
and interface: null
javax.jbi.messaging.MessagingException: Could not find route for exchange:
InOnly[
id: ID:192.168.1.2-12af3420074-8:1
status: Active
role: provider
service: {http://servicemix.apache.org/samples/filemover}fileSender
in: null
] for service: {http://servicemix.apache.org/samples/filemover}fileSender
and interface: null
at
org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:297)
at
org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:88)
at
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:894)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:396)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:432)
at
org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDeliveryChannel.java:88)
at
org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndpoint.java:70)
at
org.apache.servicemix.file.FilePollerEndpoint.processFile(FilePollerEndpoint.java:391)
at
org.apache.servicemix.file.FilePollerEndpoint.processFileNow(FilePollerEndpoint.java:371)
at
org.apache.servicemix.file.FilePollerEndpoint$1.run(FilePollerEndpoint.java:320)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
ERROR - FileComponent - Failed to process file:
c:\servicemix\sender\pom.xml. Reason:
javax.jbi.messaging.MessagingException: Could n
ot find route for exchange: InOnly[
id: ID:192.168.1.2-12af3420074-8:0
status: Active
role: provider
service: {http://servicemix.apache.org/samples/filemover}fileSender
in: null
] for service: {http://servicemix.apache.org/samples/filemover}fileSender
and interface: null
javax.jbi.messaging.MessagingException: Could not find route for exchange:
InOnly[
id: ID:192.168.1.2-12af3420074-8:0
status: Active
role: provider
service: {http://servicemix.apache.org/samples/filemover}fileSender
in: null
] for service: {http://servicemix.apache.org/samples/filemover}fileSender
and interface: null
at
org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:297)
at
org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:88)
at
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:894)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:396)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:432)
at
org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDeliveryChannel.java:88)
at
org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndpoint.java:70)
at
org.apache.servicemix.file.FilePollerEndpoint.processFile(FilePollerEndpoint.java:391)
at
org.apache.servicemix.file.FilePollerEndpoint.processFileNow(FilePollerEndpoint.java:371)
at
org.apache.servicemix.file.FilePollerEndpoint$1.run(FilePollerEndpoint.java:320)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
--
View this message in context: http://servicemix.396122.n5.nabble.com/moving-files-tp2808055p2823329.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
Re: moving files
Posted by sou <so...@gmail.com>.
this the solution that i tried , it's extracted from the instruction about
servicemix-file int the tutorial:
<?xml version="1.0"?>
<beans xmlns:f="http://servicemix.apache.org/file/1.0"
xmlns:proj="http://servicemix.apache.org/samples/filemover"
xmlns:sm="http://servicemix.apache.org/config/1.0">
<f:sender service="proj:fileSender"
endpoint="endpoint"
directory="file:///c:/servicemix/sender"
autoCreateDirectory="true">
<property name="marshaler">
<bean
class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
</property>
</f:sender>
<f:poller
service="proj:filePoller"
endpoint="poller"
file="file:///c:/servicemix/poller"
targetService="proj:fileSender"
targetEndpoint="endpoint"
period="60000"
recursive="true"
autoCreateDirectory="true">
<property name="marshaler">
<bean
class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
</property>
</f:poller>
</beans>
--
View this message in context: http://servicemix.396122.n5.nabble.com/moving-files-tp2808055p2821580.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
Re: moving files
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
to move files (whatever the file type), you need to use a
BinaryFileMarshaler in place of the default one in the file component :
<file:poller ....>
<property name="marshaler">
<bean class="org.apache.servicemix.components.util.BinaryFileMarshaler"/>
</property>
</file:poller>
But, be careful, in the NMR, only XML message payload is supported, so
it depends of the target services.
Regards
JB
On 09/08/2010 05:22 PM, sou wrote:
>
> Hi, i'm new user of servicemix.
> i'm following the tutorial and it works: i maked a SU that move an xml file
> from a directory to another and send a message to jms. But i want to move
> other types of files not only xml also i want to make a filer to chosse file
> that should be moved by name or extension. I checked the page talking about
> servicemix-file and i make my own solution but it don't work and when i
> start servicemix there is many errors.So please i need help to change my SU
> to mov other types of files and thanks a lot