Connecting using Coldfusion/Java

Questions dealing with specific FTP clients and Cerberus FTP Server.
Post Reply
jward23
New User
Posts: 3
Joined: Tue Dec 13, 2011 1:58 pm

Connecting using Coldfusion/Java

Post by jward23 » Tue Dec 13, 2011 2:22 pm

I am able to connect to Cerberus (5.0.0.5) using the web browser or using a CoreFTP client, but I can't connect programatically using org.apache.commons.net.ftp.FTPClient. Below is my code (this is actually using the java ftpclient through Coldfusion) :

ftpsClient = CreateObject("java","org.apache.commons.net.ftp.FTPClient").init();
ftpsClient.connect(JavaCast("string","xxx.xxx.xxx.xxx"),21);
connected = ftpsClient.isConnected();

login = ftpsClient.login(JavaCast("string","username"),JavaCast("string","password"));

This is what I see in the log file:

2011/12/13 13:47:54 [0] Client connected to Cerberus FTP Server 5.0.0.5 on 'machine'

2011/12/13 13:48:41 [1] Incoming connection request on FTP interface 0 at xxx.xxx.xxx.xxx
2011/12/13 13:48:41 [1] FTP connection request accepted from xxx.xxx.xxx.xxx
2011/12/13 13:48:45 [1] USER svc.script
2011/12/13 13:48:45 [1] 331 User svc.script, password please

At this point the Coldfusion/Java client returns "Truncated server reply". I also tried not using the login, and instead sending the user command and pass command separately like this:

userCmd = ftpsClient.sendCommand(JavaCast("string","USER" ),JavaCast("string","username" ));

But as soon as I send the "USER" command I see the above in the log file and the same reply, "Truncated server reply".

Does anyone have any ideas? Thanks much.

User avatar
Serin
Site Administrator
Posts: 1785
Joined: Sat Jan 01, 2005 6:57 pm
Location: United States
Contact:

Re: Connecting using Coldfusion/Java

Post by Serin » Tue Dec 13, 2011 7:59 pm

I just happen to have that package and a test program ready so I could duplicate this fairly easily. There appears to be a bug in the org.apache.commons.net.ftp.FTPClient command processor that doesn't like extra "\r" codes in the welcome message. I've added some additional scrubbing to the welcome message to filter these out. If you grab and install the latest release from the website these issues should go away. I haven't changed the version so it is still 5.0.0.5.

jward23
New User
Posts: 3
Joined: Tue Dec 13, 2011 1:58 pm

Re: Connecting using Coldfusion/Java

Post by jward23 » Wed Dec 14, 2011 9:29 am

Yes! That did it. Thanks for the quick reply!

Jim

Post Reply