Java - networking - why working in Lin and not Win?
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)
inside of the storeFile method will return null if the _openDataConnection_
call fails - which it does.
if (__dataConnectionMode != ACTIVE_LOCAL_DATA_CONNECTION_MODE &&
__dataConnectionMode != PASSIVE_LOCAL_DATA_CONNECTION_MODE)
if (__dataConnectionMode == ACTIVE_LOCAL_DATA_CONNECTION_MODE)
server = _socketFactory_.createServerSocket(0, 1,
so I have already tried all 4 possible modes defined by commons.net
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!