Results 1 to 4 of 4

Thread: Spring ftp adding ftp location to localpath in windows.

  1. #1
    Join Date
    May 2011
    Location
    Mumbai, India
    Posts
    93

    Question Spring ftp adding ftp location to localpath in windows.

    Hi,
    I have written a ftp file download code using spring integration ftp. The code works fine on linux machines. Today I moved my code to test server which is a windows machine.

    When I tried running file download schedular I got
    org.springframework.integration.MessagingException : java.io.FileNotFoundException:

    The problem is, that the ftpclient is adding the ftp location path to my local path.
    Eg: FTP LOCATION - MyFTP/myremotefolder
    EG: LOCAL LOCATION - mylocalfolder/users

    But while copying the file, I get the following logs:

    WARN 2013-02-02 17:30:01,250 [pool-4-thread-1] (MessagingGatewaySupport.java:240) (doSendAndReceive) - failure occurred in gateway sendAndReceive
    org.springframework.integration.MessagingException : java.io.FileNotFoundException: mylocalfolder\users\MyFTP\myremotefolder\file_2013 0202.csv.writing (The system cannot find the path specified)

    The code was working fine in linux machines. I am using the windows ftp client.

    Where am I going wrong. Please help.

    Regards,
    Annuk

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,020

    Default

    Please show your Spring Integration configuration (for the FTP components) and tell us what version of Spring Integration you are using.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    May 2011
    Location
    Mumbai, India
    Posts
    93

    Default

    Hi Gary,

    Thanks for your reply.
    The problem is solved. I am using SI 2.2 and Spring 3.2

    The problem was with the separator that was used. I was using a '\' instead of '/'.

    Will the separator cause the problem?

    Regards,
    Annuk.

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    Hi, Annuk!
    The problem was with the separator that was used. I was using a '\' instead of '/'
    Yes, it is on the Windows.
    Please, read the JavaDocs of: PathMatchingResourcePatternResolver
    So, the main requirement is: always use '/' independently of OS.

    Take care,
    Artem

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •