Hello all, I'm having an issue that doesn't seem to be addressed anywhere on the forum. So here is my problem:
I have an inbound channel adapter set up to pick up files from a remote directory. Simple. Also, I have a message store reaper to expire messages after a certain timeout. Good so far. However, I'm getting an error that the two cannot synchronize because a file cannot be found (this is sent to an error channel). Here is my code, edited to preserve company information.
Code:<sprint:publish-subscribe-channel id="myChannel"> <sprint:interceptors> <sprint:wire-tap channel="inboundLogger" /> </sprint:interceptors> </sprint:publish-subscribe-channel> <sftp:inbound-channel-adapter id="pull.gfmhost.824.udf" session-factory="gfmHostSftpSessionFactory" channel="myChannel" remote-directory="${pull.directory}" local-directory="${local.directoy}" auto-create-local-directory="true" cache-sessions="false" delete-remote-files="true"> <sprint:poller fixed-rate="${defined.interval}" max-messages-per-poll="-1" error-channel="errorChannel"/> </sftp:inbound-channel-adapter> <bean id="myTransformer" class="myProject.MyTransformer" /> <bean id="myAggregator" class="myProject.MyAggregator"> <constructor-arg name="path" value="${agg.directory}"/> </bean> <sprint:channel id="outPutChannel" > <sprint:interceptors> <sprint:wire-tap channel="outboundLogger" /> </sprint:interceptors> </sprint:channel> <sprint:chain input-channel="myChannel" output-channel="outPutChannel" > <sprint:transformer ref="myTransformer" /> <sprint:aggregator send-partial-result-on-expiry="true" discard-channel="errorChannel" ref="fileAggregator" method="aggregateFiles" message-store="messageStore"/> </sprint:chain> <file:outbound-gateway directory="${backup.dir}" request-channel="outPutChannel" delete-source-files="true" reply-channel="mergeChannel"/> <bean id="messageStore" class="org.springframework.integration.store.SimpleMessageStore"/> <bean id="messageStoreReaper" destroy-method="destroy" class="org.springframework.integration.store.MessageGroupStoreReaper"> <property name="messageGroupStore" ref="messageStore"/> <property name="timeout" value="${release.merge}" /> </bean> <task:scheduled-tasks scheduler="scheduler" > <task:scheduled ref="messageStoreReaper" method="run" fixed-rate="100000" /> </task:scheduled-tasks> <task:scheduler pool-size="5" id="scheduler"/>EDIT: Stack traceCode:Feb 28 15:56:13 [scheduler-2] DEBUG MessageGroupStoreReaper run Expiring all messages older than timeout=60000 from message group store: org.springframework.integration.store.SimpleMessageStore@97c9cf Feb 28 15:56:55 [task-scheduler-9] DEBUG ShellCommandExecutor call Set Permissions: 0 Feb 28 15:56:55 [task-scheduler-5] DEBUG AbstractInboundFileSynchronizer copyFileToLocalDirectory cannot copy, not a file: (this is the remote directory)/in/. Feb 28 15:56:55 [task-scheduler-5] DEBUG AbstractInboundFileSynchronizer copyFileToLocalDirectory cannot copy, not a file: (this is the remote directory)/in/.. Feb 28 15:56:56 [task-scheduler-8] DEBUG ShellCommandExecutor call Set Permissions: 0 Feb 28 15:56:56 [task-scheduler-6] DEBUG AbstractMessageChannel$ChannelInterceptorList preSend preSend on channel 'errorChannel', message: [Payload=org.springframework.integration.MessagingException: Problem occurred while synchronizing remote to local directory][Headers={timestamp=1362085016712, id=838d4aa6-54dd-49ba-854d-b5e23d1b3da9, history=errorChannel}] Feb 28 15:56:56 [task-scheduler-6] DEBUG AbstractMessageHandler handleMessage org.springframework.integration.stream.CharacterStreamWritingMessageHandler#0 received message: [Payload=org.springframework.integration.MessagingException: Problem occurred while synchronizing remote to local directory][Headers={timestamp=1362085016712, id=838d4aa6-54dd-49ba-854d-b5e23d1b3da9, history=errorChannel}] Feb 28 15:56:56 [task-scheduler-6] DEBUG AbstractMessageChannel$ChannelInterceptorList postSend postSend (sent=true) on channel 'errorChannel', message: [Payload=org.springframework.integration.MessagingException: Problem occurred while synchronizing remote to local directory][Headers={timestamp=1362085016712, id=838d4aa6-54dd-49ba-854d-b5e23d1b3da9, history=errorChannel}]
Things I've tried so far:Code:org.springframework.integration.MessagingException: Problem occurred while synchronizing remote to local directory at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:156) at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.receive(AbstractInboundFileSynchronizingMessageSource.java:144) at org.springframework.integration.endpoint.SourcePollingChannelAdapter.doPoll(SourcePollingChannelAdapter.java:89) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146) at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:207) 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:202) 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:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: org.springframework.core.NestedIOException: Failed to remove file: 2: File not found at org.springframework.integration.sftp.session.SftpSession.remove(SftpSession.java:68) at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.copyFileToLocalDirectory(AbstractInboundFileSynchronizer.java:217) at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:150) ... 19 more
Adding filename-pattern="*" to the adapter
...and that's all. I can't think of anything to do. Any thoughts?


Reply With Quote
