Java - networking - why working in Lin and not Win?
Hi all,
I have written an FTP upload applet using Apache commons.net's FTP package
that works fine in Linux on the Linux JRE, but absolutely refuses to work on
any Windows machine with the latest Windows JRE. Several Windows machines
with the same version of the Windows JRE have been tried, "straight" XP
machines as well as SP1 and SP2 machines.
I have traced the problem to Commons.net's storeFile function - this keeps
returning null on the Windows JRE. Examination of the commons.net FTP source
code seems to imply that the call
if ((socket = _openDataConnection_(command, remote)) == null)
return false;
inside of the storeFile method will return null if the _openDataConnection_
call fails - which it does.
_openDataConnection contains
if (__dataConnectionMode != ACTIVE_LOCAL_DATA_CONNECTION_MODE &&
__dataConnectionMode != PASSIVE_LOCAL_DATA_CONNECTION_MODE)
return null;
if (__dataConnectionMode == ACTIVE_LOCAL_DATA_CONNECTION_MODE)
{
ServerSocket server;
server = _socketFactory_.createServerSocket(0, 1,
getLocalAddress());
etc.
so I have already tried all 4 possible modes defined by commons.net
(ACTIVE_LOCAL_DATA_CONNECTION_MODE, ACTIVE_REMOTE_DATA_CONNECTION_MODE,
PASSIVE_LOCAL_DATA_CONNECTION_MODE and PASSIVE_REMOTE_DATA_CONNECTION_MODE)
on all my Windows machines, but still I keep ketting a null back from
storeFile on the Windows JRE, while everything keeps working fine in the
Linux JRE, no matter what mode I select.
I have also ran FTP clients on all the Windows machines, and they work fine to
the test FTP server the Java code in the Windows JRE fails on- so the ports
and physical and logical network setup on the test Windows machines are fine
for FTP. Correct?
Any idea WHY this fails -only- on Windows machines on the Windows JRE? It
works fine in the Linux JRE, no errors, no exceptions. Is Commons.net only
specified for Linux?
Once more, Linux blows the socks off Windows...
ANY help appreciated!
|