LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 09-02-2005, 04:55 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,477

Rep: Reputation: 87
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inet ok, yast update not ok, win to lin ok, lin to win not ok captain skywave Linux - Networking 4 08-22-2005 03:17 AM
Errors When I copied Win files from Lin back to Win! dougp25 Linux - General 2 09-15-2004 06:03 AM
Win to Lin - which software? linmix Linux - Software 2 06-17-2004 02:39 PM
win to lin-lin to win aamehl Linux - Networking 5 09-10-2003 04:10 AM
Win 4 Lin ??? landshark753 Linux - General 1 02-01-2002 01:55 PM


All times are GMT -5. The time now is 01:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration