This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Don't groan - this is not a "typical" "I don't know why I'm getting access is denied" question
I am testing a prototype applet on my local system - all it does is try to execute notepad.exe on my system. (Just as an FYI, the end result applet will be used in a web based application distributed to our users who want the capability of being able to execute scripts/executables on the local system from our web based app.)
I am using 1.6.0_13 JRE (and JDK).
I have signed the applet, I have set up everything as if I were the recepient (i.e. using policy tool to grant permissions, gave FileIoPermission for WINDOWS directory with execute, read, and write, set ALLPermissions, etc.), and have even modified java.security to point to my policy file (note I modified all files on all JREs just to be sure). I have waded through tons of documentation on sun and elsewhere to see what is up and how to set it up and what I might be doing wrong to no avail. Am I desperate? YES!
I am thinking that perhaps I am specifying the various file names incorrectly (some of the documents show setting the paths in the various places as file:/C:/WINDOWS/, some as /WINDOWS/, some as file://C:/WINDOWS/, some as C\:\\WINDOWS\\) and I have tried changing all the various permutations in all the various places with no success. Or perhaps missing an entry somewhere? At this point I am just plain confused.
So if you can give me some pointers and/or definitive answers on how the paths etc should be typed, or some insight into what I am not doing correctly it would greatly be appreciated.
I have signed the applet, I have set up everything as if I were the recepient (i.e. using policy tool to grant permissions, gave FileIoPermission for WINDOWS directory with execute, read, and write, set ALLPermissions, etc.), and have even modified java.security to point to my policy file (note I modified all files on all JREs just to be sure).
If the applet is signed, then there's no need to modify any of the security policy files - a signed applet has all the permissions it could have.
"profitool" was the alias I assigned when I was setting up the keystore and policy stuff as the "end user". These were the instructions I originally followed for signing, setting up the policy file as the "end user", etc:
FYI, Went this route because I was getting the "access denied" thing right off the bat and checking the documentation led me there as a solution.
Granting the permissions in java.policy didn't solve my issue - I am still getting the same error message.
1. If I change it to use the codebase, what should I put in since I do not have a URL? Do I enter the full path (i.e. C:\MyDir\com\profitool\applet? What would be the correct syntax?
2. Again, right now I am just testing the "prototype" so I am just launching the html file directly (using appletviewer and/or just double clicking on the html file to launch in browser window). Should I be doing this differently?
3. I have never received a dialog box asking me to "trust it" - is that because I am not launching the applet from an actual web site page? I am using both Firefox 3.0 and IE 7.0 to test with.
At any rate, I am now trying the privileged mode - I am going to wipe out all of the policy stuff since I have to resign etc and see where that takes me.
Joined: Apr 27, 2009
Update at 1:57 PM MDT
So I tried the privileged method and still get access denied. I even modified java.policy to have :