Results 1 to 7 of 7

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

  1. #1
    Join Date
    Jun 2011
    Location
    Tampa FL
    Posts
    14

    Default 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 Source.java:132)
    at org.springframework.integration.endpoint.SourcePol lingChannelAdapter.doPoll(SourcePollingChannelAdap ter.java:89)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call(AbstractPollingEndpoint.java :145)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call(AbstractPollingEndpoint.java :143)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller$1.run(AbstractPollingEndpoin t.java:206)
    at org.springframework.integration.util.ErrorHandling TaskExecutor$1.run(ErrorHandlingTaskExecutor.java: 52)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    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(SftpSession.java:83)
    at org.springframework.integration.sftp.session.SftpS ession.list(SftpSession.java:43)
    at org.springframework.integration.file.remote.sessio n.CachingSessionFactory$CachedSession.list(Caching SessionFactory.java:133)
    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 elSftp.java:2108)
    at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java :1676)
    at com.jcraft.jsch.ChannelSftp.stat(ChannelSftp.java: 1651)
    at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:11 98)
    at org.springframework.integration.sftp.session.SftpS ession.list(SftpSession.java:71)
    ... 12 more

  2. #2
    Join Date
    Aug 2005
    Location
    Atlanta
    Posts
    123

    Default

    Hi,

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

    Thanks!

  3. #3
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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. #4
    Join Date
    Jun 2011
    Location
    Tampa FL
    Posts
    14

    Default

    Here is my configuration.

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

  5. #5
    Join Date
    Jun 2011
    Location
    Tampa FL
    Posts
    14

    Default

    Hi Oleg,

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

  6. #6
    Join Date
    Aug 2005
    Location
    Atlanta
    Posts
    123

    Default

    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:

    https://jira.springsource.org/browse/INT-1921

    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:

    remote-file-separator="/"

    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. #7
    Join Date
    Jun 2011
    Location
    Tampa FL
    Posts
    14

    Default

    ghillert,

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

    Regards,
    Sashank Mitra

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
  •