Announcement Announcement Module
Collapse
No announcement yet.
Spring ftp adding ftp location to localpath in windows. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Please show your Spring Integration configuration (for the FTP components) and tell us what version of Spring Integration you are using.

    Comment


    • #3
      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.

      Comment


      • #4
        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

        Comment

        Working...
        X