我有一个ftp入站文件同步器。
正在发生的事情总结在此堆栈跟踪中:
failure occurred in messaging taskjava.io.IOException: Failed to copy 'ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt'. Server replied with: 550 "ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt": no such file.
at org.springframework.integration.ftp.session.FtpSession.read(FtpSession.java:85) ~[na:na]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.copyRemoteContentToLocalFile(AbstractInboundFileSynchronizer.java:443) ~[na:na]
... 27 common frames omitted
Wrapped by: org.springframework.messaging.MessagingException: Failure occurred while copying 'ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt' from the remote to the local directory; nested exception is java.io.IOException: Failed to copy 'ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt'. Server replied with: 550 "ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt": no such file.
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.copyRemoteContentToLocalFile(AbstractInboundFileSynchronizer.java:450) ~[na:na]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.copyFileToLocalDirectory(AbstractInboundFileSynchronizer.java:406) ~[na:na]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.transferFilesFromRemoteToLocal(AbstractInboundFileSynchronizer.java:342) ~[na:na]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.lambda$synchronizeToLocalDirectory$0(AbstractInboundFileSynchronizer.java:309) ~[na:na]
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:437) ~[na:na]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:308) ~[na:na]
... 22 common frames omitted
Wrapped by: org.springframework.messaging.MessagingException: Problem occurred while synchronizing 'ANI Feeds/2019/ANI Pictures/07/24' to local directory; nested exception is org.springframework.messaging.MessagingException: Failure occurred while copying 'ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt' from the remote to the local directory; nested exception is java.io.IOException: Failed to copy 'ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt'. Server replied with: 550 "ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt": no such file.
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:315) ~[na:na]
at com.afrozaar.ashes.ingestor.ani.CustomFtpInboundFileSynchronizer.synchronizeToLocalDirectory(CustomFtpInboundFileSynchronizer.java:23) ~[na:na]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:258) ~[na:na]
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:64) ~[na:na]
at org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource.doReceive(AbstractFetchLimitingMessageSource.java:45) ~[na:na]
at org.springframework.integration.endpoint.AbstractMessageSource.receive(AbstractMessageSource.java:160) ~[na:na]
at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:250) ~[na:na]
at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:360) ~[na:na]
at org.springframework.integration.endpoint.AbstractPollingEndpoint.pollForMessage(AbstractPollingEndpoint.java:329) ~[na:na]
at org.springframework.integration.endpoint.AbstractPollingEndpoint.lambda$null$1(AbstractPollingEndpoint.java:277) ~[na:na]
at org.springframework.integration.util.ErrorHandlingTaskExecutor.lambda$execute$0(ErrorHandlingTaskExecutor.java:57) ~[na:na]
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) ~[spring-core-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:55) ~[na:na]
at org.springframework.integration.endpoint.AbstractPollingEndpoint.lambda$createPoller$2(AbstractPollingEndpoint.java:274) ~[na:na]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_201]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_201]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_201]
如果您没有看到根本错误:
Server replied with: 550 "ANI Feeds/2019/ANI Pictures/07/24/20190724057C-tokyo-governor-koike-tokyo-2020-president-mori-ioc-president-bach-and-japans-pm-abe-attend-the-one-year-to-go-ceremony-celebrating-one-year-out-from-the-start-of-the-summer-games-in-tokyo.txt": no such file.
因此出现了ftp故障,但问题是无法解决此错误。由于此错误,此异常将永久抛出-即在每次轮询时都无法加载文件,因此永远不会将其放入元数据存储中。
我想知道的是如何“吞噬”此错误并移至下一个文件?
我确实怀疑这是因为文件名的大小。 Ftp未下载它,因为它太大。在那里,就像在扫描目录时发现的那样,但是到下载目录时,失败了。
答案 0 :(得分:0)
您可以手动将错误的文件添加到MetadataStore
。
或者您可以对过滤器进行子类化,覆盖rollback()
以跳过回滚列表中的第一个文件。
但是,不幸的是,rollback()
没有执行回滚的原因的信息,因此即使出现其他错误,该操作也会始终跳过第一个文件。