0
I have a problem trying to connect FTP. For Filezila, it works normally.... but when I try for this code snippet, it generates the following exception: jAva.net.Bindexception: Cannot assign requested address: Jvm_bind The error occurs when I call ftp.connect(); Searching for the solution, I saw that I had to use FTP in passive mode, but I could not, already tried to use: enterRemoteActiveMode(), enterLocalPassiveMode(), enterLocalActiveMode() but nothing solved.... anyone has any idea ?
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();
}
.....
.....
.....
Does this error usually occur when the port you are accessing is already in use? Make sure there is nothing running on it. PS post error stacktrace
– Marquezani
– Bruno