Thanks. Actually I wrote another task for FTPing and removed the
verification which causes it to fail.
And it worked!!
-----Original Message-----
From: Conelly, Luis (GNF, Contractor) [mailto:Luis.Conelly@gnf.com]
Sent: Monday, March 15, 2004 9:14 AM
To: Ant Users List
Subject: RE: Problem FTPing files
Are you going through a firewall? I recall FTP task does not support it (or
is it proxy?) Ohh... I see it, it's both of them.
>From Ant Manual[1]:
<quote>
This task does not currently use the proxy information set by the <setproxy>
task, and cannot go through a firewall via socks.
</quote>
I recall I had an issue like this, but with RMI. I was trying to execute an
operation from a machine to another using RMI, but we had to go through a
firewall (security issues). The task was not completed since the firewall
was masking the real IP to another IP and the RMI engine never got the
answer back. I think you might have quite an issue like that.
I took a look at the commons-net-1.1.0 source code and I found a
scenario like I am describing above (according with the javadoc provided);
this is the code:
<quote srcfile="org/apache/commons/net/ftp/FTPClient.java" line="483">
if (__remoteVerificationEnabled && !verifyRemote(socket))
{
InetAddress host1, host2;
host1 = socket.getInetAddress();
host2 = getRemoteAddress();
socket.close();
throw new IOException(
"Host attempting data connection " + host1.getHostAddress()
+
" is not same as server " + host2.getHostAddress());
}
<quote>
As you can see, the verifyRemote(socket) method is returning false, so the
exception is thrown. This method, is implemented in
org.apache.commons.net.SocketClient class:
<quote srcfile="org/apache/commons/net/SocketClient.java" line="515">
public boolean verifyRemote(Socket socket)
{
InetAddress host1, host2;
host1 = socket.getInetAddress();
host2 = getRemoteAddress();
return host1.equals(host2);
}
</quote>
This info comes from the commons.net package version 1.1.0 available online
at [2]
Hope this helps to you (or at least, gives you a clue about where to start
to look into).
-Luis
In case you wonder, this is the class hierarchy:
org.apache.commons.net.SocketClient
|
|-> org.apache.commons.net.telnet.Telnet
|
|-> org.apache.commons.net.telnet.TelnetClient
|
|-> org.apache.commons.net.ftp.FTP
|
|-> org.apache.commons.net.ftp.FTPClient
[1] http://ant.apache.org/manual/OptionalTasks/ftp.html
[2]
http://apache.towardex.com/jakarta/commons/net/source/commons-net-1.1.0-src.
zip
-----Original Message-----
From: Srivastava, Abhinav [mailto:asriva01@amgen.com]
Sent: Friday, March 12, 2004 5:21 PM
To: user@ant.apache.org
Subject: Problem FTPing files
I am trying to use FTP task of Ant. I get this error - any clues??
ant FTP -verbose
Apache Ant version 1.6.1 compiled on February 12 2004
Buildfile: build.xml
Detected Java version: 1.4 in: C:\bea\jdk141_05\jre
Detected OS: Windows 2000
parsing buildfile F:\CMA 2.0\Code\build.xml with URI =
file:///F:/CMA%202.0/Code
/build.xml
Project base dir set to: F:\CMA 2.0\Code
Build sequence for target `FTP' is [FTP]
Complete build sequence is [FTP, ZIP, INIT, PVCS, REQPRO, default, ]
FTP:
[ftp] Opening FTP connection to 203.197.109.17
[ftp] connected
[ftp] logging in to FTP server
[ftp] login succeeded
[ftp] changing the remote directory
[ftp] sending files
[ftp] disconnecting
BUILD FAILED
F:\CMA 2.0\Code\build.xml:46: error during FTP transfer:
java.io.IOException: Ho
st attempting data connection 138.133.16.26 is not same as server
203.197.109.17
at
org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2020)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
|