Hi guys,
I'm new to Spring Integration (and also new to Spring). I'm trying to establish a connection to my server via FTP, to pull some files from there and then maybe process them.
I'm getting an "Problem occurred while synchronizing remote to local directory" error, so I don't understand why.
I'm using using Spring Integration 2.1.0 (with Spring 3.1.0).
Could someone point me in the right direction? Here are some snippets of the code I'm using.
config.xml (excerpt)
"MY_SERVER" etc are replaced by other values. Just used these to anonymize.Code:<bean id="ftpSessionFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory"> <property name="host" value="MY_SERVER" /> <property name="port" value="21" /> <property name="username" value="MY_USER" /> <property name="password" value="MY_PASSWORD" /> <property name="clientMode" value="0" /> <property name="fileType" value="2" /> <property name="bufferSize" value="100000" /> </bean> <int-ftp:inbound-channel-adapter id="ftpInbound" channel="ftpChannel" session-factory="ftpSessionFactory" charset="UTF-8" auto-create-local-directory="true" delete-remote-files="true" filename-pattern="*.txt" remote-directory="/home/spring" remote-file-separator="/" local-directory="C:\\Users\\XXX\\Desktop\\TESTFOLDER\\ftp"> <si:poller fixed-rate="1000" /> </int-ftp:inbound-channel-adapter> <si:channel id="ftpChannel" /> <bean id="ftpShouter" class="com.xxx.xxx.FtpShouter" /> <si:service-activator input-channel="ftpChannel" output-channel="fileoutput" ref="ftpShouter" method="shout" />
Exerpt from pom.xml for Maven:
Stack trace:Code:<dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-core</artifactId> <version>2.1.0.RELEASE</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-file</artifactId> <version>2.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-ftp</artifactId> <version>2.1.0.RELEASE</version> </dependency>
Thank you very much!Code:Schwerwiegend: 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: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) at java.net.SocketOutputStream.write(SocketOutputStream.java:153) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291) at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) at java.io.BufferedWriter.flush(BufferedWriter.java:254) at org.apache.commons.net.ftp.FTP.__send(FTP.java:496) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:470) at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:547) at org.apache.commons.net.ftp.FTP.port(FTP.java:872) at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:667) at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2990) at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2965) at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2623) at org.springframework.integration.ftp.session.FtpSession.list(FtpSession.java:62) at org.springframework.integration.ftp.session.FtpSession.list(FtpSession.java:38) at org.springframework.integration.file.remote.session.CachingSessionFactory$CachedSession.list(CachingSessionFactory.java:139) at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:145) ... 19 more


Reply With Quote