You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by PeteLes <pi...@promutuel.ca> on 2007/07/27 18:16:09 UTC
ServiceMix Use Case : Ftp Poller
Hello!
Using ServiceMix 3.1.1 and would like to configure the following scenario:
1. Polling an ftp site, retreiving *.xml from a certain directory, deleting
after, at each morning 7 am;
2. Saving these files on the localhost.
Tried different configurations but dit not work. Here's my servicemix.xml :
<!-- Write files to the outbox directory -->
<sm:activationSpec componentName="fileSender" service="foo:fileSender">
<sm:component>
<bean class="org.apache.servicemix.components.file.FileWriter">
<property name="directory"
value="c:\donnees\servicemix\examples\file-binding\outbox" />
<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_', /sample/@id, '.xml')" />
</bean>
</property>
</bean>
</property>
</bean>
</sm:component>
</sm:activationSpec>
<sm:activationSpec componentName="ftpFilePoller"
destinationService="foo:trace" service="foo:ftpFilePoller">
<sm:component>
<ftp:component>
<ftp:endpoints>
<ftp:poller service="test:service"
endpoint="endpoint"
uri="ftp://user:password@ftpHost.ca/outbox/test"
/>
</ftp:endpoints>
</ftp:component>
</sm:component>
</sm:activationSpec>
Getting:
The prefix "ftp" for element "ftp:component" is not bound.
Also tried:
<sm:activationSpec componentName="ftpFilePoller"
destinationService="foo:trace" service="foo:ftpFilePoller">
<sm:component>
<bean class="org.apache.servicemix.components.net.FTPPoller">
<property name="clientPool">
<bean class="org.apache.servicemix.components.net.FTPClientPool">
<property name="username" value="user" />
<property name="password" value="password" />
<property name="host" value="ftpHost" />
<property name="config">
<bean class="org.apache.commons.net.ftp.FTPClientConfig">
</bean>
</property>
</bean>
</property>
<property name="path" value="/outbox/test" />
</bean>
</sm:component>
</sm:activationSpec>
Did install all the components. Trying to run ServiceMix in stand-alone. Did
I miss something?
Thanks for your help!
--
View this message in context: http://www.nabble.com/ServiceMix-Use-Case-%3A-Ftp-Poller-tf4158856s12049.html#a11832315
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: ServiceMix Use Case : Ftp Poller
Posted by Bruce Snyder <br...@gmail.com>.
On 7/30/07, PeteLes <pi...@promutuel.ca> wrote:
>
> Now erverthing's working well!
>
> Here's the last question:
>
> how can I configure ftpPoller the start at 8 am at each day? can I specify a
> cron expression ?
You could certainly do this using the QuartzComponent. See the basic
example that already uses the QuartzComponent.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/
Re: ServiceMix Use Case : Ftp Poller
Posted by PeteLes <pi...@promutuel.ca>.
Now erverthing's working well!
Here's the last question:
how can I configure ftpPoller the start at 8 am at each day? can I specify a
cron expression ?
Thanks!
Gert Vanthienen wrote:
>
> Pierre,
>
> Perhaps you haven't specified the namespace for ftp yet?
> xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
>
> Gert
>
> PeteLes wrote:
>> Hello!
>>
>> Using ServiceMix 3.1.1 and would like to configure the following
>> scenario:
>>
>> 1. Polling an ftp site, retreiving *.xml from a certain directory,
>> deleting
>> after, at each morning 7 am;
>>
>> 2. Saving these files on the localhost.
>>
>> Tried different configurations but dit not work. Here's my servicemix.xml
>> :
>>
>> <!-- Write files to the outbox directory -->
>> <sm:activationSpec componentName="fileSender" service="foo:fileSender">
>> <sm:component>
>> <bean class="org.apache.servicemix.components.file.FileWriter">
>> <property name="directory"
>> value="c:\donnees\servicemix\examples\file-binding\outbox" />
>> <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_', /sample/@id, '.xml')" />
>> </bean>
>> </property>
>> </bean>
>> </property>
>> </bean>
>> </sm:component>
>> </sm:activationSpec>
>>
>> <sm:activationSpec componentName="ftpFilePoller"
>> destinationService="foo:trace" service="foo:ftpFilePoller">
>> <sm:component>
>> <ftp:component>
>> <ftp:endpoints>
>> <ftp:poller service="test:service"
>> endpoint="endpoint"
>>
>> uri="ftp://user:password@ftpHost.ca/outbox/test"
>> />
>> </ftp:endpoints>
>> </ftp:component>
>> </sm:component>
>> </sm:activationSpec>
>>
>>
>> Getting:
>>
>> The prefix "ftp" for element "ftp:component" is not bound.
>>
>> Also tried:
>>
>> <sm:activationSpec componentName="ftpFilePoller"
>> destinationService="foo:trace" service="foo:ftpFilePoller">
>> <sm:component>
>> <bean class="org.apache.servicemix.components.net.FTPPoller">
>> <property name="clientPool">
>> <bean
>> class="org.apache.servicemix.components.net.FTPClientPool">
>> <property name="username" value="user" />
>> <property name="password" value="password" />
>> <property name="host" value="ftpHost" />
>> <property name="config">
>> <bean class="org.apache.commons.net.ftp.FTPClientConfig">
>> </bean>
>> </property>
>> </bean>
>> </property>
>> <property name="path" value="/outbox/test" />
>> </bean>
>> </sm:component>
>> </sm:activationSpec>
>>
>>
>>
>> Did install all the components. Trying to run ServiceMix in stand-alone.
>> Did
>> I miss something?
>>
>> Thanks for your help!
>>
>
>
--
View this message in context: http://www.nabble.com/ServiceMix-Use-Case-%3A-Ftp-Poller-tf4158856s12049.html#a11866390
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: ServiceMix Use Case : Ftp Poller
Posted by PeteLes <pi...@promutuel.ca>.
Ok, I did also add the servicemix-ftp-3.1.1-incubating.jar file in
servicemix/lib for the namespace.
But now, getting this error:
java.lang.NoClassDefFoundError: org/apache/servicemix/common/Default
Component
So, I've also put the servicemix-common-3.1.1-incubating.jar file in
servicemix/lib (found inside
servicemix/components/servicemix-shared-3.1.1-incubating-installer.zip).
-- Pete
Gert Vanthienen wrote:
>
> Pierre,
>
> Perhaps you haven't specified the namespace for ftp yet?
> xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
>
> Gert
>
> PeteLes wrote:
>> Hello!
>>
>> Using ServiceMix 3.1.1 and would like to configure the following
>> scenario:
>>
>> 1. Polling an ftp site, retreiving *.xml from a certain directory,
>> deleting
>> after, at each morning 7 am;
>>
>> 2. Saving these files on the localhost.
>>
>> Tried different configurations but dit not work. Here's my servicemix.xml
>> :
>>
>> <!-- Write files to the outbox directory -->
>> <sm:activationSpec componentName="fileSender" service="foo:fileSender">
>> <sm:component>
>> <bean class="org.apache.servicemix.components.file.FileWriter">
>> <property name="directory"
>> value="c:\donnees\servicemix\examples\file-binding\outbox" />
>> <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_', /sample/@id, '.xml')" />
>> </bean>
>> </property>
>> </bean>
>> </property>
>> </bean>
>> </sm:component>
>> </sm:activationSpec>
>>
>> <sm:activationSpec componentName="ftpFilePoller"
>> destinationService="foo:trace" service="foo:ftpFilePoller">
>> <sm:component>
>> <ftp:component>
>> <ftp:endpoints>
>> <ftp:poller service="test:service"
>> endpoint="endpoint"
>>
>> uri="ftp://user:password@ftpHost.ca/outbox/test"
>> />
>> </ftp:endpoints>
>> </ftp:component>
>> </sm:component>
>> </sm:activationSpec>
>>
>>
>> Getting:
>>
>> The prefix "ftp" for element "ftp:component" is not bound.
>>
>> Also tried:
>>
>> <sm:activationSpec componentName="ftpFilePoller"
>> destinationService="foo:trace" service="foo:ftpFilePoller">
>> <sm:component>
>> <bean class="org.apache.servicemix.components.net.FTPPoller">
>> <property name="clientPool">
>> <bean
>> class="org.apache.servicemix.components.net.FTPClientPool">
>> <property name="username" value="user" />
>> <property name="password" value="password" />
>> <property name="host" value="ftpHost" />
>> <property name="config">
>> <bean class="org.apache.commons.net.ftp.FTPClientConfig">
>> </bean>
>> </property>
>> </bean>
>> </property>
>> <property name="path" value="/outbox/test" />
>> </bean>
>> </sm:component>
>> </sm:activationSpec>
>>
>>
>>
>> Did install all the components. Trying to run ServiceMix in stand-alone.
>> Did
>> I miss something?
>>
>> Thanks for your help!
>>
>
>
--
View this message in context: http://www.nabble.com/ServiceMix-Use-Case-%3A-Ftp-Poller-tf4158856s12049.html#a11865317
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: ServiceMix Use Case : Ftp Poller
Posted by PeteLes <pi...@promutuel.ca>.
Hi!
Yes, was forgetting to add that, but, when running ServiceMix, I got this
error:
Unrecognized xbean namespace mapping: http://servicemix.apache.org/ftp/1.0
I can't neither connect to this URL.
Thanks for your help!
-- Pete
Gert Vanthienen wrote:
>
> Pierre,
>
> Perhaps you haven't specified the namespace for ftp yet?
> xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
>
> Gert
>
> PeteLes wrote:
>> Hello!
>>
>> Using ServiceMix 3.1.1 and would like to configure the following
>> scenario:
>>
>> 1. Polling an ftp site, retreiving *.xml from a certain directory,
>> deleting
>> after, at each morning 7 am;
>>
>> 2. Saving these files on the localhost.
>>
>> Tried different configurations but dit not work. Here's my servicemix.xml
>> :
>>
>> <!-- Write files to the outbox directory -->
>> <sm:activationSpec componentName="fileSender" service="foo:fileSender">
>> <sm:component>
>> <bean class="org.apache.servicemix.components.file.FileWriter">
>> <property name="directory"
>> value="c:\donnees\servicemix\examples\file-binding\outbox" />
>> <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_', /sample/@id, '.xml')" />
>> </bean>
>> </property>
>> </bean>
>> </property>
>> </bean>
>> </sm:component>
>> </sm:activationSpec>
>>
>> <sm:activationSpec componentName="ftpFilePoller"
>> destinationService="foo:trace" service="foo:ftpFilePoller">
>> <sm:component>
>> <ftp:component>
>> <ftp:endpoints>
>> <ftp:poller service="test:service"
>> endpoint="endpoint"
>>
>> uri="ftp://user:password@ftpHost.ca/outbox/test"
>> />
>> </ftp:endpoints>
>> </ftp:component>
>> </sm:component>
>> </sm:activationSpec>
>>
>>
>> Getting:
>>
>> The prefix "ftp" for element "ftp:component" is not bound.
>>
>> Also tried:
>>
>> <sm:activationSpec componentName="ftpFilePoller"
>> destinationService="foo:trace" service="foo:ftpFilePoller">
>> <sm:component>
>> <bean class="org.apache.servicemix.components.net.FTPPoller">
>> <property name="clientPool">
>> <bean
>> class="org.apache.servicemix.components.net.FTPClientPool">
>> <property name="username" value="user" />
>> <property name="password" value="password" />
>> <property name="host" value="ftpHost" />
>> <property name="config">
>> <bean class="org.apache.commons.net.ftp.FTPClientConfig">
>> </bean>
>> </property>
>> </bean>
>> </property>
>> <property name="path" value="/outbox/test" />
>> </bean>
>> </sm:component>
>> </sm:activationSpec>
>>
>>
>>
>> Did install all the components. Trying to run ServiceMix in stand-alone.
>> Did
>> I miss something?
>>
>> Thanks for your help!
>>
>
>
--
View this message in context: http://www.nabble.com/ServiceMix-Use-Case-%3A-Ftp-Poller-tf4158856s12049.html#a11864555
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: ServiceMix Use Case : Ftp Poller
Posted by Gert Vanthienen <ge...@skynet.be>.
Pierre,
Perhaps you haven't specified the namespace for ftp yet?
xmlns:ftp="http://servicemix.apache.org/ftp/1.0"
Gert
PeteLes wrote:
> Hello!
>
> Using ServiceMix 3.1.1 and would like to configure the following scenario:
>
> 1. Polling an ftp site, retreiving *.xml from a certain directory, deleting
> after, at each morning 7 am;
>
> 2. Saving these files on the localhost.
>
> Tried different configurations but dit not work. Here's my servicemix.xml :
>
> <!-- Write files to the outbox directory -->
> <sm:activationSpec componentName="fileSender" service="foo:fileSender">
> <sm:component>
> <bean class="org.apache.servicemix.components.file.FileWriter">
> <property name="directory"
> value="c:\donnees\servicemix\examples\file-binding\outbox" />
> <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_', /sample/@id, '.xml')" />
> </bean>
> </property>
> </bean>
> </property>
> </bean>
> </sm:component>
> </sm:activationSpec>
>
> <sm:activationSpec componentName="ftpFilePoller"
> destinationService="foo:trace" service="foo:ftpFilePoller">
> <sm:component>
> <ftp:component>
> <ftp:endpoints>
> <ftp:poller service="test:service"
> endpoint="endpoint"
> uri="ftp://user:password@ftpHost.ca/outbox/test"
> />
> </ftp:endpoints>
> </ftp:component>
> </sm:component>
> </sm:activationSpec>
>
>
> Getting:
>
> The prefix "ftp" for element "ftp:component" is not bound.
>
> Also tried:
>
> <sm:activationSpec componentName="ftpFilePoller"
> destinationService="foo:trace" service="foo:ftpFilePoller">
> <sm:component>
> <bean class="org.apache.servicemix.components.net.FTPPoller">
> <property name="clientPool">
> <bean class="org.apache.servicemix.components.net.FTPClientPool">
> <property name="username" value="user" />
> <property name="password" value="password" />
> <property name="host" value="ftpHost" />
> <property name="config">
> <bean class="org.apache.commons.net.ftp.FTPClientConfig">
> </bean>
> </property>
> </bean>
> </property>
> <property name="path" value="/outbox/test" />
> </bean>
> </sm:component>
> </sm:activationSpec>
>
>
>
> Did install all the components. Trying to run ServiceMix in stand-alone. Did
> I miss something?
>
> Thanks for your help!
>