Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection closed without indication.

Status
Not open for further replies.

yodaa

Programmer
Jun 10, 2004
64
SE
I have the strangest problem. I'm connection to a server (Linux machine) within our intranet using Apache's commons package. When I execute a simple java code on my Windows XP machine everything works as it should but when I use the code as a package for a servlet code (running on Linux) things goes wrong. I get the message "Connection closed without indication.", so it does connect but it drops the connection immediately. I never get the chance to login to the server. I can connect to the host by typing "ftp nnn.nnn.nnn.nnn" in the Linux command promt, so I'm very confused here.

Maybe I'm forgetting to make a setting or something.


Thanks a million for any help given!

Code:
String host = "nnn.nnn.nnn.nnn";
String path = "some/path";
String username = "username";
String password = "password";
FTPClient ftp = new FTPClient();
FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
ftp.configure(conf);
ftp.connect(host); // This is where it goes wrong!
ftp.login( username, password );
 
Does FTPClient do any GUI stuff? The servlet will run 'headless' I believe.

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
No it does not. Locations, hosts etc are hardcoded and no the user cannot change that kind of setting using a GUI or any other method. Damn weird.
 
Stefan, I've tested with and without FTPClientConfig, no change. What makes this more weird is that I can connect to other computer within the intranet but the computer I want to connect to won't cooperate.

Is there any setting else on client side that one can change to make it less "sensitive" for replies from the server or something? It's damn weird this.
 
Hm - I'm not sure.
I'm using the '~/.netrc'-File to be able to connect with auto-login to my favorite places, and perhaps it only worked because of that?

And I didn't transfer anything - just opened the connection.

If you would provide some more code, I could test a small real file-transfer, and would disable my entry from .netrc
.
Did you test different server?

seeking a job as java-programmer in Berlin:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top