Bug 41724 - FTP task failed after connected to the server and throws null pointer exception
Summary: FTP task failed after connected to the server and throws null pointer exception
Status: RESOLVED WONTFIX
Alias: None
Product: Ant
Classification: Unclassified
Component: Optional Tasks (show other bugs)
Version: 1.6.5
Hardware: Other other
: P3 normal with 1 vote (vote)
Target Milestone: 1.7.1
Assignee: Ant Notifications List
URL:
Keywords:
: 44528 47075 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-02-28 04:41 UTC by SV
Modified: 2009-04-24 23:12 UTC (History)
3 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SV 2007-02-28 04:41:26 UTC
I have return an ant script, that will task config.xml files from 10 servers, 
my script is working well for 8 servers and it is not working well for 2 
servers. Here I have given the output of the script, can you please help me, 
it is very urgent

test:
     [echo] ------------------------------- Connecting Test Server ------------
--------------------------
      [ftp] Opening FTP connection to 10.*.*.*
      [ftp] connected
      [ftp] logging in to FTP server
      [ftp] login succeeded
      [ftp] changing the remote directory
      [ftp] getting files
Could not load a dependent class (com/sun/media/jai/codec/FileSeekableStream) 
for type image
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (junit/framework/Test) for type junit
fileset: Setup scanner in dir C:\test\HK\February-2007\GlobalHub\T3 with 
patternSet{ includes: [config.xml] excludes: [] }
will try to cd to _CFGWIZ_DONOTDELETE where a directory called 
_cfgwiz_donotdelete exists
      [ftp] disconnecting

BUILD FAILED
C:\Test\HK\build_monthly.xml:220: java.lang.NullPointerException
        at org.apache.tools.ant.Task.perform(Task.java:373)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.NullPointerException
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.checkRemoteS
ensitivity(FTP.java:536)
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.listFiles
(FTP.java:507)
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scandir
(FTP.java:329)
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.checkInclude
Patterns(FTP.java:233)
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scan
(FTP.java:197)
        at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles
(FTP.java:1287)
        at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles
(FTP.java:1382)
        at org.apache.tools.ant.taskdefs.optional.net.FTP.execute
(FTP.java:2010)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        ... 10 more
--- Nested Exception ---
java.lang.NullPointerException
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.checkRemoteS
ensitivity(FTP.java:536)
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.listFiles
(FTP.java:507)
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scandir
(FTP.java:329)
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.checkInclude
Patterns(FTP.java:233)
        at 
org.apache.tools.ant.taskdefs.optional.net.FTP$FTPDirectoryScanner.scan
(FTP.java:197)
        at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles
(FTP.java:1287)
        at org.apache.tools.ant.taskdefs.optional.net.FTP.transferFiles
(FTP.java:1382)
        at org.apache.tools.ant.taskdefs.optional.net.FTP.execute
(FTP.java:2010)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Comment 1 J.M. (Martijn) Kruithof 2007-09-10 10:44:21 UTC
Cause of fault found, fixed.
Comment 2 J.M. (Martijn) Kruithof 2008-02-29 12:53:29 UTC
For change see:
http://svn.apache.org/viewvc?view=rev&revision=574313
Comment 3 Jeffrey E. Care 2008-02-29 13:33:52 UTC
We're seeing something very similar.

I'm not sure yet, but at this point I'm suspecting that the underlying issue is a bug in how commons-net handles leap year (i.e. Feb. 29th) in the list parsing code.

Will update as investigation continues.
Comment 4 Jeffrey E. Care 2008-02-29 16:33:59 UTC
Related to http://issues.apache.org/jira/browse/NET-188

Honestly I'm not sure of the proper disposition here; clearly the underlying problem is with commons-net, but until they provide a fix this bug will continue to happen.

I should also point out that that the fix made under revision 574313 only eliminates the NPE; it doesn't do anything to solve the underlying problem that FTP list entry parsing fails for files last modified on leap-day. A side effect of the fix made under revision 574313 is data loss in FTP file listings.
Comment 5 Stefan Bodewig 2008-07-14 06:59:33 UTC
I don't think we can (or even should try to) fix anything for commons-net, all we can do is point people to download a snapshot build of 1.5.0.

I don't see how we can avoid the data loss (log that there was another file but we don't know anything about it?).

WONTFIX as far as I'm concerned.
Comment 6 Stefan Bodewig 2008-07-14 07:10:52 UTC
*** Bug 44528 has been marked as a duplicate of this bug. ***
Comment 7 Stefan Bodewig 2008-10-23 08:48:56 UTC
please give commons-net 2.0 a try.

Comment 8 J.M. (Martijn) Kruithof 2009-04-24 23:12:56 UTC
*** Bug 47075 has been marked as a duplicate of this bug. ***