java.security.AccessControlException

I am running an aglet which gets an exception when it tries to access a local file.

since aglets are not allowed to access local files, i granted permission in aglets.policy file also like:

grant

codeBase "file:/C:/aglets-2.0.2/public/my/aglets/-"

{

permission java.io.FilePermission "c:\\aglets-2.0.2\\public\\my\\aglets\\agent.java", "write";

};

The exact exception i get is as follows:

java.security.AccessControlException: access denied (java.io.FilePermission c:\a

glets-2.0.2\public\my\aglets\agent.java write)

at java.security.AccessControlContext.checkPermission(AccessControlConte

xt.java:269)

at java.security.AccessController.checkPermission(AccessController.java:

401)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)

at com.ibm.aglets.tahiti.AgletsSecurityManager.checkPermission(Unknown S

ource)

at java.lang.SecurityManager.checkWrite(SecurityManager.java:954)

at java.io.FileOutputStream.<init>(FileOutputStream.java:169)

at java.io.FileOutputStream.<init>(FileOutputStream.java:102)

at java.io.FileWriter.<init>(FileWriter.java:61)

at my.aglets.Interface.run(Interface.java:62)

at com.ibm.aglets.SystemMessage.handle(Unknown Source)

at com.ibm.aglets.AgletThread.run(Unknown Source)

please help me in this regard

thanks in advance

[1447 byte] By [vengatesha] at [2007-11-26 18:23:46]
# 1
Try file:/// etc in your codebase instead of file:/.
ejpa at 2007-7-9 5:57:50 > top of Java-index,Core,Core APIs...
# 2
Thanks for your replybut still i get that error
vengatesha at 2007-7-9 5:57:50 > top of Java-index,Core,Core APIs...
# 3
OK, so is that the correct setting for the codebase? Is that the root of a hierarchy of .class files organized into directories corresponding to the package structure? or are you running from a JAR file? in which case the JAR file needs to be named in the codebase.
ejpa at 2007-7-9 5:57:50 > top of Java-index,Core,Core APIs...
# 4
yeah. all the specified paths are right.i am not running a jar file but class file and that is also in the correct package only.i am not able to find out the flaw here.
vengatesha at 2007-7-9 5:57:50 > top of Java-index,Core,Core APIs...
# 5
Can you try your FilePermission with / instead of \\ throughout?
ejpa at 2007-7-9 5:57:50 > top of Java-index,Core,Core APIs...