Spring интеграции FTP-сервер ответил: 426 Ошибка передачи - PullRequest
0 голосов
/ 14 января 2020

В настоящее время я работаю над весенней интеграцией с поддержкой FTP.

Я сделал перевод из локального каталога на удаленный FTP-сервер, но получаю Сервер ответил: 426 Ошибка передачи ошибка.

Caused by: org.springframework.messaging.MessagingException: Failed to write to '/4001/in/temp/V31406_200000_120001.writing' while uploading the file; nested exception is java.io.IOException: Failed to write to '/4001/in/temp/V31406_200000_120001.writing'. Server replied with: 426 Transfer failed

       at org.springframework.integration.file.remote.RemoteFileTemplate.sendFileToRemoteDirectory(RemoteFileTemplate.java:592)
       at org.springframework.integration.file.remote.RemoteFileTemplate.lambda$send$0(RemoteFileTemplate.java:319)

Ниже приведен код фабричной сессии.

@Bean
@Order(Ordered.HIGHEST_PRECEDENCE)
public SessionFactory<FTPFile> ftpSessionFactory() {
    DefaultFtpSessionFactory ftpSessionFactory = new DefaultFtpSessionFactory();
    ftpSessionFactory.setHost(ftpHost);
    ftpSessionFactory.setPort(ftpPort);
    ftpSessionFactory.setUsername(ftpUser);
    ftpSessionFactory.setPassword(ftpPasword);

    LOGGER.info("ftpHost : {}  ftpPort: {}  ftpUser: {} ftpPasword: {} ", ftpHost, ftpPort, ftpUser, ftpPasword);

    ftpSessionFactory.setClientMode(0);

    return new CachingSessionFactory<FTPFile>(ftpSessionFactory, 10);
}
...