Linux下的java项目使用JCIFS访问windows的附件服务器连接超时?

问题描述

使用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();
    }


阅读 1.5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题