JCIFS访问被拒绝 [英] JCIFS Access is denied

查看:98
本文介绍了JCIFS访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JCIFS写入Windows共享。这一直工作正常。突然它停止工作,我现在得到一个jcifs.smb.SmbAuthException:访问被拒绝。例外。我知道我的凭证是好的,因为我可以手动连接使用smb并写入文件夹,所以这不是问题。我使用的代码是:
$ b $ pre $ NtlmPasswordAuthentication ntlm = new NtlmPasswordAuthentication(domain,userName,smbPassword);
SmbFile文件=新SmbFile(smbPath,ntlm);

SmbFileOutputStream outputStream = new SmbFileOutputStream(file)

outputStream.write(fileContents)
outputStream.close()

它在SmbFileOutputStream outputStream = new SmbFileOutputStream(file)行中爆发。这一切都没有改变几个月,一直工作得很好,所以我不知道为什么它会停止工作。有没有人有任何想法?由于我知道我的凭证很好,而且我确实有写入权限,所以我在这里完全失败。

错误消息以及您描述的是目标服务器上的文件权限问题。



更新
已确认(通过评论)当试图替换现有文件时它是一个权限问题。


I'm using JCIFS to write to a windows share. This has been working fine. All of a sudden it stopped working and I'm now getting a jcifs.smb.SmbAuthException: Access is denied. exception. I know that my credentials are good as I can connect using smb manually and write to the folder, so that's not the problem. The code I'm using is:

NtlmPasswordAuthentication ntlm = new NtlmPasswordAuthentication(domain, userName, smbPassword);
SmbFile file = new SmbFile(smbPath, ntlm);

SmbFileOutputStream outputStream = new SmbFileOutputStream(file)

outputStream.write(fileContents)
outputStream.close()

It blows up on the "SmbFileOutputStream outputStream = new SmbFileOutputStream(file)" line. None of this has changed for months and has been working fine, so I'm not sure why it would stop working. Does anyone have any ideas? I'm at a complete loss here since I know my credentials are good and that I do have write access

解决方案

As indicated by the error message and what you are describing it is a file permission issue on the target server.

Updated Confirmed (via comments) that it was a permissions issue when attempting to replace an existing file.

这篇关于JCIFS访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆