Results 1 to 8 of 8

Thread: FTP file name character limit???

  1. #1
    Join Date
    Jul 2012
    Posts
    4

    Default FTP file name character limit???

    Hello,

    I am developing an application that needs to FTP files to a remote destination. Currently everything works as expected; however when I try to send a file with a name that exceeds 150 characters I am experiencing issues. It appears long file names will cause a Socket exception when trying to rename the file. I believe the problem occurs when the file is being renamed from the ".writing" form to the target file name, because the file is transferred successfully as ".writing" before the exception is thrown. The file names I am working with are very long and my application needs to be able to handle file name lengths of at least 256 characters. Is there a way to fix this issue?

    Thanks in advance

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    can you post an exception stack trace?

  3. #3
    Join Date
    Jul 2012
    Posts
    4

    Default

    Here is the full stack trace (I changed project/file names and directories):

    org.springframework.integration.MessageDeliveryExc eption: Error handling message for file [C:\apps1\batch\data\my_project_directory\really_lo ng_file_name_over_one_hundred_and_fifty_characters .XLS]
    at org.springframework.integration.file.remote.handle r.FileTransferringMessageHandler.handleMessageInte rnal(FileTransferringMessageHandler.java:129)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:78)
    at org.springframework.integration.monitor.SimpleMess ageHandlerMetrics.handleMessage(SimpleMessageHandl erMetrics.java:108)
    at org.springframework.integration.monitor.SimpleMess ageHandlerMetrics.invoke(SimpleMessageHandlerMetri cs.java:88)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy43.handleMessage(Unknown Source)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :110)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 7)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:61)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:183)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :150)
    at org.springframework.integration.monitor.DirectChan nelMetrics.monitorSend(DirectChannelMetrics.java:1 07)
    at org.springframework.integration.monitor.DirectChan nelMetrics.doInvoke(DirectChannelMetrics.java:91)
    at org.springframework.integration.monitor.DirectChan nelMetrics.invoke(DirectChannelMetrics.java:85)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy27.send(Unknown Source)
    at com.companyname.batch.myproject.MyProjectTasklet.f tp(MyProjectTasklet.java:156)
    at com.companyname.batch.myproject.MyProjectTasklet.e xecute(MyProjectTasklet.java:91)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:183)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :150)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.doProceed(DelegatingIntroductionIn terceptor.java:131)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.invoke(DelegatingIntroductionInter ceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy94.execute(Unknown Source)
    at org.springframework.batch.core.step.tasklet.Taskle tStep$ChunkTransactionCallback.doInTransaction(Tas kletStep.java:386)
    at org.springframework.transaction.support.Transactio nTemplate.execute(TransactionTemplate.java:130)
    at org.springframework.batch.core.step.tasklet.Taskle tStep$2.doInChunkContext(TaskletStep.java:264)
    at org.springframework.batch.core.scope.context.StepC ontextRepeatCallback.doInIteration(StepContextRepe atCallback.java:76)
    at org.springframework.batch.repeat.support.RepeatTem plate.getNextResult(RepeatTemplate.java:367)
    at org.springframework.batch.repeat.support.RepeatTem plate.executeInternal(RepeatTemplate.java:214)
    at org.springframework.batch.repeat.support.RepeatTem plate.iterate(RepeatTemplate.java:143)
    at org.springframework.batch.core.step.tasklet.Taskle tStep.doExecute(TaskletStep.java:250)
    at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:195)
    at org.springframework.batch.core.job.SimpleStepHandl er.handleStep(SimpleStepHandler.java:135)
    at org.springframework.batch.core.job.flow.JobFlowExe cutor.executeStep(JobFlowExecutor.java:61)
    at org.springframework.batch.core.job.flow.support.st ate.StepState.handle(StepState.java:60)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:144)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
    at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:135)
    at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:281)
    at com.companyname.batch.CustomJobLauncher$1.run(Cust omJobLauncher.java:131)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: org.springframework.integration.MessagingException : Failed to write to 'FTP_REMOTE_DEIRECTORY\really_long_file_name_over_ one_hundred_and_fifty_characters.XLS.writing' while uploading the file
    at org.springframework.integration.file.remote.handle r.FileTransferringMessageHandler.sendFileToRemoteD irectory(FileTransferringMessageHandler.java:205)
    at org.springframework.integration.file.remote.handle r.FileTransferringMessageHandler.handleMessageInte rnal(FileTransferringMessageHandler.java:118)
    ... 57 more
    Caused by: java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream. java:147)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.j ava:264)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.ja va:306)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:1 58)
    at java.io.InputStreamReader.read(InputStreamReader.j ava:167)
    at java.io.BufferedReader.fill(BufferedReader.java:13 6)
    at java.io.BufferedReader.readLine(BufferedReader.jav a:299)
    at java.io.BufferedReader.readLine(BufferedReader.jav a:362)
    at org.apache.commons.net.ftp.FTP.__getReply(FTP.java :294)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.jav a:490)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.jav a:534)
    at org.apache.commons.net.ftp.FTP.dele(FTP.java:1214)
    at org.apache.commons.net.ftp.FTPClient.deleteFile(FT PClient.java:1741)
    at org.springframework.integration.ftp.session.FtpSes sion.rename(FtpSession.java:108)
    at org.springframework.integration.file.remote.sessio n.CachingSessionFactory$CachedSession.rename(Cachi ngSessionFactory.java:149)
    at org.springframework.integration.file.remote.handle r.FileTransferringMessageHandler.sendFileToRemoteD irectory(FileTransferringMessageHandler.java:202)
    ... 58 more
    Last edited by a5s; Jul 9th, 2012 at 01:36 PM.

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Are you abel to transfer the files via command line?
    This might be a limitation of your file system

  5. #5
    Join Date
    Jul 2012
    Posts
    4

    Default

    Yes, I am able to transfer file names greater than 150 characters from the command line. However it does appear rename times out...

    421 Service not available, remote server has closed connection
    Last edited by a5s; Jul 9th, 2012 at 02:02 PM.

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    what version of SI you are using? Looking at your stack trace seems like a bit old

  7. #7
    Join Date
    Jul 2012
    Posts
    4

    Default

    We are using version 2.0.3

  8. #8
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    That's pretty old. So although I am pretty sure it wil not resolve your issue I'd stil suggest ti upgrade to 2.1.3 andpost the freshest stacktrace so we can figure out what's going on.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •