问题描述
使用jcifs连接windows的附件服务器,在本机eclipes启动可以访问,正式服务器的linux一直报connection timeout,但是如果在本机启动并操作了附件,正式服务器这时也可以了
问题出现的平台版本及自己尝试过哪些方法
相关代码
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, adminName, adminPassword);
SmbFile remoteFile = new SmbFile(smbUrl.toString()+url,auth);
remoteFile.connect();
response.setCharacterEncoding("utf-8");
response.setContentType(type);
InputStream smbInputStream = new BufferedInputStream(new SmbFileInputStream(remoteFile));
try{
StreamUtils.copy(smbInputStream,response.getOutputStream());
}finally{
smbInputStream.close();
}