• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

HELP! Weird bug in commons.net.ftp

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been using commons.net.ftp.FTPClient for over a year now, without any problems. Suddenly, when calling FTPClient.listFiles(), some of the entries in the returned list are NULLs (ie: some of the files on the server are listed, and some result in NULLs). But FTPClient.listNames() returns the filenames correctly! I'm at my wits end. Has anyone else had this problem before?

Here's some sample code:
 
Sheriff
Posts: 26770
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What changed on your server?
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nothing. But files that were uploaded before yesterday are working fine (they show up in the .listFiles() results), and files that were added since then are returning NULLs in the .listFiles() results (one NULL entry for each file). So I get a mix of normal FTPFile instances, and NULLs.
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
update: If I call .listNames(), then cycle through the results, calling .listFiles for each filename, I get an empty array for each problem file...

so like:
 
Paul Clapham
Sheriff
Posts: 26770
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Philippe Desrosiers:
nothing.

No, something changed on your server. For example, there are different files on the server today than were there yesterday. And for example today is February 29 and not February 28, although you wouldn't think that software would have leap-year problems after all these years. Something is different.

Have you tried connecting to the FTP server from the command line and doing a DIR command to see what you can see?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've just started using the commons net FTPClient in the past two days and today experienced this same problem with files that have a Feb 29 timestamp. Everything has pointed to a leap-year problem with commons.net.ftp.FTPClient.

All other FTP clients have no problems on the same server (not controlled by me but used by '00s of others).

At least it won't bother us again for another 4 years

Dave
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic