aspose file tools*
The moose likes I/O and Streams and the fly likes FTP Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » I/O and Streams
Reply locked New topic
Author

FTP Issue

chennai Kumar
Ranch Hand

Joined: Jun 04, 2005
Posts: 72
Hai All,

I am using "org.apache.commons.net.ftp.FTPClient" jar file to upload the files in FTP server.I tested standalone java application in my local system its working fine and files are placed in FTP server also.
But in production its not working.
When run command prompt with same FTP user name and password in production,it connects FTP server and places the files FTP also . But when run my standalone application connection is created succesfully but when transfer the file


"connection refused","java.net.connect Exception " is comming on following line.

"flag=fclient.storeFile("/" + strftpdir + "/" + strFileName,
is);"

The same code working fine in my local machine.Please help me to solve the issue. This is very urgent, because error in production server.

Please help Me,
Thanks in Advance,
Abiramkumar
chennai Kumar
Ranch Hand

Joined: Jun 04, 2005
Posts: 72
Hai All,

Please give me any sugesstion.

Thanks and Regards,
Abiramkumar
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

Where is the FTP Server located? Is it in a different subnet/network as that of your local machine?


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
chennai Kumar
Ranch Hand

Joined: Jun 04, 2005
Posts: 72
Dear Raghavan,

Thanks for your reply, two servers are different network.

Thanks and Regards,
Abiramkumar.P
chennai Kumar
Ranch Hand

Joined: Jun 04, 2005
Posts: 72
Dear All,

Finally i solved ftp issue.

Regards,
Abiram kumar
chennai Kumar
Ranch Hand

Joined: Jun 04, 2005
Posts: 72
Dear All,

Finally i solved ftp issue.

Regards,
Abiram kumar
chennai Kumar
Ranch Hand

Joined: Jun 04, 2005
Posts: 72
Friends,
Thanks for all replys!!!

Still i have a problem in production server.I have an one doubt,Please clarrify.
When cronjob runs, PWD shows following path.



My main class is in Datasync.jar, i set in CLASSPATH.My modified sh file as below,



When run manually in runtime folder it is running fine.So i added following two lines in sh file.



When cronjob run it goes to " data/userhome/wmsuser/ " So i used cd / to travell to root directory and moved to runtime package. This is right or how to give correct path.Please correct me.

Where i can see cronjob log file.

Please help me to solve this problem.
chennai Kumar
Ranch Hand

Joined: Jun 04, 2005
Posts: 72
Sorry ,by mistaken i posted in I/O and stream ,Same question i posted in " Linux / UNIX " Please dont reply here.

Thanks and Regards,
Abiramkumar.P
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FTP Issue