sftp get服务器无文件会抛异常,sftp 异常,有遇到的吗

时间:2025-03-21 09:27:12

满意答案

();之前看看password设置了么?

if(ua!=null){

auth_cancel=false;

try{

auth=(this); if(auth &&

().isEnabled()){

().log(,

"Authentication succeeded ("+method+").");

}

}

catch(JSchAuthCancelException ee){

auth_cancel=true; }

catch(JSchPartialAuthException ee){

smethods=();

smethoda=(smethods, ",");

methodi=0;

//("PartialAuth: "+methods);

auth_cancel=false;

continue loop;

}

catch(RuntimeException ee){

throw ee;

}

catch(Exception ee){

//("ee: "+ee); // SSH_MSG_DISCONNECT: 2 Too many authentication failures

break loop;

}

}

}

break;

}

if(!auth){

if(auth_cancel)

throw new JSchException("Auth cancel"); throw new JSchException("Auth fail");

}

[/color]

另见UserAuthPassword 中

[color=red] if(!("Password for "+dest)){

throw new JSchAuthCancelException("password");

//break;

}

String _password=();

if(_password==null){

throw new JSchAuthCancelException("password");

//break;

}

00分享举报