質問

Hi I have a java application which creates an xml file on a remote shared folder. If I run through eclipse it creates the xml file without any problem. But if i create a jar and try to run the same, it throws exception message "Access is denied" . I can manually create a file on that shared folder and both are on same network running 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. By the way below are the vm arguments that i am using

-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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top