简体   繁体   English

Java - 无法在具有完全写入权限的共享文件夹上创建文件

[英]Java - Unable to create a file on a shared folder with full write access

Hi I have a java application which creates an xml file on a remote shared folder. 嗨,我有一个java应用程序,它在远程共享文件夹上创建一个xml文件。 If I run through eclipse it creates the xml file without any problem. 如果我运行eclipse,它会毫无问题地创建xml文件。 But if i create a jar and try to run the same, it throws exception message "Access is denied" . 但是如果我创建一个jar并尝试运行它,它会抛出异常消息“访问被拒绝”。 I can manually create a file on that shared folder and both are on same network running windows xp. 我可以在该共享文件夹上手动创建一个文件,两者都在运行Windows XP的同一网络上。 I am not sure if anybody has noticed this problem. 我不确定是否有人注意到这个问题。 Please provide your suggestions. 请提供您的建议。 I am using Java 6 SDK with eclipse 3.5. 我正在使用带有eclipse 3.5的Java 6 SDK。 By the way below are the vm arguments that i am using 顺便说一句下面是我正在使用的vm参数

-Dsun.java2d.d3d=false 
-Dcom.sun.management.jmxremote=true 
-XX:+HeapDumpOnOutOfMemoryError  
-Djava.security.policy=C:\server.policy
-Dlog4j.configuration=file:///C:/config/log4j.xml

My server policy file 我的服务器策略文件

grant {
  permission java.security.AllPermission;
};

To sum up the comments: 总结评论:

If you are using JWS then perhaps the code is not executed with the the login user's privileges but with administrator privileges or even some other technical user's privileges. 如果您正在使用JWS,那么代码可能不会以登录用户的权限执行,而是具有管理员权限甚至其他技术用户的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM