Announcement Announcement Module
No announcement yet.
Error when using int-sftp:inbound-channel-adapter. Using the 2.0.3 RELEASE version Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error when using int-sftp:inbound-channel-adapter. Using the 2.0.3 RELEASE version

    I get the following error when the int-sftp:inbound-channel-adapter starts.
    I checked the host/user/password/port values are all correct.
    The local and remote directories have proper file permissions etc. Any thing that I am doing wrong here? Request for suggestions.

    org.springframework.integration.MessagingException : Problem occurred while synchronizing remote to local directory
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizer.synchronize ToLocalDirectory(AbstractInboundFileSynchronizer.j ava:136)
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizingMessageSour ce.receive(AbstractInboundFileSynchronizingMessage
    at org.springframework.integration.endpoint.SourcePol lingChannelAdapter.doPoll(SourcePollingChannelAdap
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$ :145)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$ :143)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller$
    at org.springframework.integration.util.ErrorHandling TaskExecutor$ 52)
    at java.util.concurrent.ThreadPoolExecutor$ Task(
    at java.util.concurrent.ThreadPoolExecutor$ (
    Caused by: org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
    at org.springframework.integration.sftp.session.SftpS ession.list(
    at org.springframework.integration.sftp.session.SftpS ession.list(
    at org.springframework.integration.file.remote.sessio n.CachingSessionFactory$CachedSession.list(Caching
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizer.synchronize ToLocalDirectory(AbstractInboundFileSynchronizer.j ava:125)
    ... 9 more
    Caused by: 2: No such file
    at com.jcraft.jsch.ChannelSftp.throwStatusError(Chann
    at com.jcraft.jsch.ChannelSftp._stat( :1676)
    at com.jcraft.jsch.ChannelSftp.stat( 1651)
    at 98)
    at org.springframework.integration.sftp.session.SftpS ession.list(
    ... 12 more

  • #2

    Can you please post your spring integration configuration for the SFTP Inbound Channel Adapter?



    • #3
      Also, you might want to upgrade to 2.0.4 since there were some changes and bug fixes that might be related to your issue


      • #4
        Here is my configuration.

        <int-sftp:inbound-channel-adapter id="sftpInbondAdapter"
        channel="ftp_Channel_1" session-factory="sftpSessionFactory"
        local-directory="${sftp.localDir}" remote-directory="${sftp.remoteDir}"
        auto-create-local-directory="true" delete-remote-files="false"
        <intoller task-executor="custom-pool" fixed-rate="1000" />
        <task:executor id="custom-pool" pool-size="5-20" queue-capacity="100"
        keep-alive="120" />


        • #5
          Hi Oleg,

          I get the same error even after upgrading the version to 2.0.4 latest GA build.


          • #6
            First of all, thanks for your original question. The issue you encountered has been fixed several days ago. The fix will be part of the upcoming 2.0.5 release (Scheduled for June 27, 2011). Please see the following Jira for reference:


            Thus, if you upgrade to the latest Snapshot release, your issue should go away.

            Furthermore, there are several other easy workarounds available for the existing 2.0.4 release to solve your issue. In my opinion the best solution would be to explicitly specify the "remote-file-separator" attribute on the "int-sftp:inbound-channel-adapter" element, such as:


            Alternatively, as long as you ensure that the "remote-directory" has a trailing path separator you should be fine as well (e.g. remote-directory="/poll/")

            Please let us know if this fixes your issue.


            • #7

              Thanks for your quick response. The work around solved my problem.

              Sashank Mitra