Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4k views
in Java FTP by (160 points)
I just downloaded the edtFTPj/SSL package and am getting the following error when calling the .connect() method. I tried the example code and get the same error. See below. I am running java 1.4.2_03. Also, I was able to get the non-ssl package working with a regular ftp server. I am trying to connect to a FTPS server now.

Error:
Exception in thread "main" java.lang.NoSuchFieldError: U
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.connect(Unknown Source)
at FtpFile.connectFTPHost(FtpFile.java:102)
at FtpFile.main(FtpFile.java:21)


A snippet of my code is:
String host = "172.30.7.13";
String username = "ajrodrig";
String password = "";

System.out.println("Creating client object");
SSLFTPClient ftpcon = new SSLFTPClient(host,SSLFTPClient.ConfigFlags.DISABLE_SSL_CLOSURE);

System.out.println("Setting validate server");
ftpcon.setValidateServer(false);

System.out.println("connecting");
ftpcon.connect(); //failing here //line 102

System.out.println("Setting authentication");
ftpcon.auth(SSLFTPClient.AUTH_SSL);

System.out.println("Logging in");
ftpcon.login(username, password);

System.out.println("Setting connect mode");
ftpcon.setConnectMode(com.enterprisedt.net.ftp.FTPConnectMode.PASV);

System.out.println("setting transfer type");
ftpcon.setType(FTPTransferType.ASCII);



Please help. Thanks!
Ari

2 Answers

0 votes
by (162k points)
Hi

It is quite likely you have the plain edtftpj jar file in your CLASSPATH - these classes are included in edtftpjssl.jar - and you are getting a version clash.

Make sure that edtftpj.jar is NOT in your CLASSPATH.

I just downloaded the edtFTPj/SSL package and am getting the following error when calling the .connect() method. I tried the example code and get the same error. See below. I am running java 1.4.2_03. Also, I was able to get the non-ssl package working with a regular ftp server. I am trying to connect to a FTPS server now.

Error:
Exception in thread "main" java.lang.NoSuchFieldError: U
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.connect(Unknown Source)
at FtpFile.connectFTPHost(FtpFile.java:102)
at FtpFile.main(FtpFile.java:21)

0 votes
by (160 points)
That fixed my problem. Thanks a lot for your help!

Ari

Categories

...