I'm having trouble trying to connect to FTP. For FileZila, it works normally .... but when I try for this code, it generates the following exception: j ava.net.BindException: Can not assign requested address: JVM_Bind The error occurs when I call ftp.connect (); I have tried to use FTP in passive mode, but I have not tried it, I tried to use it: enterRemoteActiveMode (), enterLocalPassiveMode (), enterLocalActiveMode () but nothing solved ..... anyone have any ideas? p>
try {
this.beginTransaction(xxxxxxx);
//Configura Conexão FTP
InetAddress localhost = xxxxx;
InetAddress destino =xxxx;
cdPortaFTP = xxxxx;
if(!ftp.isConnected()){
//Faz conexão FTP
ftp.connect(destino, cdPortaFTP, localhost, cdPortaFTP);
}
//ftp.enterRemoteActiveMode();
//ftp.enterLocalPassiveMode();
//ftp.enterLocalActiveMode();
// verifica se conectou com sucesso e faz login
if (FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
ftp.login(xxxx,xxxx);
} else {
ftp.disconnect();
throw new Exception();
}
.....
.....
.....