I can do this in java, but I would like to set up a route in camel.xml that
pulls files from an NT FTP Server.  I believe all I have to do is create a
new FTPClient instance that uses the NTFTPFileEntryParser and add that
ftpClient instance to the route url.  Here's what I set up in camel.xml.

<route>
  <from
uri="ftp://user@host?delay=60000&amp;password=xxxxxx&amp;delete=false&amp;disconnect=true&amp;readLock=changed&amp;ftpClient=#NTFTPClient"/>
  <to uri="file:c:/aaa/315_NTFTP"/>
</route>

...

<bean id="Factory"
class="org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory"
/>
<bean id="Parser" factory-bean="Factory"
factory-method="createNTFTPEntryParser" />
<bean id="NTFTPClient" class="org.apache.commons.net.ftp.FTPClient">
   <property name="parserFactory" ref="Parser"/>
</bean>


But I'm getting the following exception:

ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'NTFTPClient' defined in class path resource [camel.xml]:
Initializati
on of bean failed; nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to convert
property value of type
'org.apache.commons.net.ftp.parser.CompositeFileEntryParser' to required
type 'org.apache.c
ommons.net.ftp.parser.FTPFileEntryParserFactory' for property
'parserFactory'; nested exception is java.lang.IllegalStateException: Cannot
convert value of type
[org.apache.commons.net.ftp.parser.CompositeFileEntryParser] to requi
red type [org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory] for
property 'parserFactory': no matching editors or conversion strategy found
java.lang.RuntimeException: Failed to execute start task. Reason:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'NTFTPClient' defined in class path resource [camel.xml]:
Initialization of b
ean failed; nested exception is
org.springframework.beans.ConversionNotSupportedException: Failed to convert
property value of type
'org.apache.commons.net.ftp.parser.CompositeFileEntryParser' to required
type 'org.apache.commons.
net.ftp.parser.FTPFileEntryParserFactory' for property 'parserFactory';
nested exception is java.lang.IllegalStateException: Cannot convert value of
type [org.apache.commons.net.ftp.parser.CompositeFileEntryParser] to
required typ
e [org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory] for property
'parserFactory': no matching editors or conversion strategy found


Can someone show me the correct way to set up camel.xml to create an
FTPClient that parsers NT Entries?

I know there are newer versions of camel, but I'm using camel 2.7.0.
I'm also using JDK6.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Howto-set-up-an-NT-FTP-Client-in-Spring-tp5768540.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to