0

The spring boot app copies files from remote sftp server to shared location on network

it works fine with my embedded tomcat server inside intellij but fails when deployed as war to server with the following message

Caused by: java.io.FileNotFoundException: sharedfolder
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.onInit(AbstractInboundFileSynchronizingMessageSource.java:187)
    ... 72 more

Here is the code

Properties file

sftp.local.directory.xml.download=\\\\somename\\\parentfolder\\sharedfolder

Sync

@Bean
@InboundChannelAdapter(channel = "fromSftpChannel1", poller = @Poller(cron = "${sftp.cronExpression}"))
public MessageSource<File> sftpMessageXMLSource() {
    SftpInboundFileSynchronizingMessageSource source = new SftpInboundFileSynchronizingMessageSource(
            sftpInboundFileSynchronizerXML());

    log.info("Local dir: " + new File(sftpLocalDirectoryDownloadXML));
    source.setLocalDirectory(new File(sftpLocalDirectoryDownloadXML));
    source.setAutoCreateLocalDirectory(false);
    source.setLocalFilter(new AcceptOnceFileListFilter<File>());
    return source;
}
Ravi Yenugu
  • 3,895
  • 5
  • 40
  • 58

0 Answers0