1

Мы выставляем файл на каком-то SFTP-сервере, а затем запускаем весенний пакет. После выполнения весеннего пакетного запуска под шагами.Spring Batch issue: «Проблемы возникли при синхронизации удаленных файлов с локальным каталогом»

  1. выбор файл с FTP адреса

  2. процесс файл.

  3. удалить файл.

Мы сталкиваемся с приведенным ниже исключением, а весенняя партия выполняет вышеуказанные шаги.

ERROR org.springframework.integration.handler.LoggingHandler: 140 - org.springframework.integration.MessagingException: Problem occurred while synchronizing remote to local directory 
      at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:189) 
      at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.receive(AbstractInboundFileSynchronizingMessageSource.java:162) 
      at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:111) 
      at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:184) 
      at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:51) 
      at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:143) 
      at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:141) 
      at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:273) 
      at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) 
      at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48) 
      at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49) 
      at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:268) 
      at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) 
      at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) 
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) 
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
      at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) 
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(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.integration.MessagingException: Failed to execute on session 
      at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:306) 
      at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:163) 
      ... 21 more 
     Caused by: org.springframework.core.NestedIOException: Failed to remove file: 2: Specified file path is invalid. 
      at org.springframework.integration.sftp.session.SftpSession.remove(SftpSession.java:83) 
      at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.copyFileToLocalDirectory(AbstractInboundFileSynchronizer.java:230) 
      at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.access$100(AbstractInboundFileSynchronizer.java:59) 
      at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:172) 
      at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:163) 
      at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:297) 
      ... 22 more 

ответ

1

Возможно, проблема с безопасностью - возможно, у вас нет разрешений на удаление.

Тот же путь используется для извлечения и при удалении (если он настроен на удаление удаленного файла после извлечения). Очевидно, что выборка работала нормально, потому что теперь мы находимся в стадии удаления.

Необходимо обратиться к журналам сервера.

+0

спасибо за ваш ответ. Но мы не уверены, что это исключение произошло, когда весенняя партия выполняла операцию удаления. Возможно, у вас есть какое-либо другое предложение, чтобы проверить это. –

+0

Трассировка стека ясно показывает, что интеграция с весной затрудняет удаление файла с удаленного сервера после его загрузки. Весенняя партия не участвует в этом пункте. –