Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.7k views
in Java FTP by (240 points)
i am using edtftpj-1.5.2.jar and also test with edtftpj-1.5.3.jar and write my own wrapper to access the base functionalty of edtftpj.

on my development enviroment it work fine but on my production enviroment it give the following exception:....

Exception in thread "Thread-3" java.lang.IllegalAccessError: tried to access method com.enterprisedt.net.ftp.FTPClient.<init>()V from class com.ab.service.billpaymentschedularservice.FTPService.FTP
at com.ab.service.billpaymentschedularservice.FTPService.FTP.connect(FTP.java:94)

my development enviroment is Windows XP, and production RHEL (Linux) 3.0

my connect method is as follows:

public boolean connect() throws IOException, Exception {
    boolean istrue = false;
    try {
      Logger.setLevel(Level.ALL);
      // set up client
      ftp = new FTPClient();
      ftp.setRemoteHost(ftpAddress);
      ftp.setRemotePort(ftpPort);

      listener = new FTPMessageCollector();
      ftp.setMessageListener(listener);
      //ftp.setAutoPassiveIPSubstitution(true);

      // connect
      log.info("Connecting");
      ftp.connect();

      log.info("****FTP Connection successfull*****");

//      if ((ftpUser == null || ftpUser != "") && (ftpPassword == null || ftpPassword != "")) {
      ftp.login(ftpUser, ftpPassword);
//      }
      // set up passive ASCII transfers
      log.debug("Setting up passive, ASCII transfers");
      ftp.setConnectMode(FTPConnectMode.PASV);
      ftp.setType(FTPTransferType.ASCII);

      if (ftpPath == null || ftpPath != "") {
        ftp.chdir(ftpPath);
      }
      istrue = true;
    }
    catch (FTPException fex) {
      log.error("FTPException in i2cFTP Connect" + fex.toString());
      fex.printStackTrace();
      throw fex;
    }
    catch (IOException ioe) {
      log.error("IOException in i2cFTP Connect" + ioe.toString());
      ioe.printStackTrace();
      throw ioe;
    }
    catch (Exception ex) {
      log.error("****i2cFTP Connection FAILED*****" +
                "\nException:FTP Connection FAILED. due to Net Work Problem: Connect @JFTP");
      ex.printStackTrace();
      throw ex;
    }
    return istrue;
  }


i didnt find any help on this here in forum.

kindly guide me what is wrong i m doing. ASAP

5 Answers

0 votes
by (162k points)
One possibility is that you have two versions (two different jars) in the CLASSPATH.
0 votes
by (240 points)
please confirm me either position of the jar in class path matter. which i dont think so but in my case when i change the position of the jar in class path it works fine.

kindly discuss this ......
0 votes
by (162k points)
It won't matter what position the jar is in the classpath UNLESS you have more than one version or jar file in the classpath. Or perhaps you have the pro version in the classpath, which has classes in common with the free version. Then things mightn't work properly.

please confirm me either position of the jar in class path matter. which i dont think so but in my case when i change the position of the jar in class path it works fine.

kindly discuss this ......
0 votes
by (240 points)
actually i already have edtftpjpro licenced for sftp transmission in the classpath. and now i m including edtftpj for ftp transmission and u have menstion that it is the problem.

Thank you very much for giving solution. it really worked.


Question: just tell me that is edtftpjpro work for FTP transmission or not??
0 votes
by (162k points)
All of edtFTPj's functionality (including classes) is included in edtFTPj/PRO, so you can use j/pro for ordinary (non-secure) FTP.

Question: just tell me that is edtftpjpro work for FTP transmission or not??

Categories

...