applets grants permission in Netscape

I wrote a applet and want to grant permission to read property.
I add the following code.
netscape.security.PrivilegeManager.enablePrivilege("UniversalProperty read);

Then I use System.getProperty("user.home").
When I run the applet, I see a dialog box asking me to grant or deny permission.( Because I haven't signed my applet, it said my is not digitally signed). Then I pressed grant button.
But when running the getProperty statement. The following error
occurs

# Applet exception: security.checkpropsaccess.key

netscape.security.AppletSecurityException: security.checkpropsaccess.key

  at java.lang.Throwable.<init>(Compiled Code)

  at java.lang.Exception.<init>(Compiled Code)

  at java.lang.RuntimeException.<init>(Compiled Code)

  at java.lang.SecurityException.<init>(Compiled Code)

  at netscape.security.AppletSecurityException.<init>(Compiled Code)

  at netscape.security.AppletSecurityException.<init>(Compiled Code)

  at netscape.security.AppletSecurity.checkPropertyAccess(Compiled Code)

  at java.lang.SecurityManager.checkPropertyAccess(Compiled Code)

* at java.lang.System.getProperty(Compiled Code)

  at Capture.run(Compiled Code)

  at java.lang.Thread.run(Compiled Code)

java.io.IOException: CreateProcess: vcafe -netscape error=2

  at java.lang.Win32Process.<init>(Compiled Code)

  at java.lang.Runtime.exec(Compiled Code)

* at java.lang.Runtime.exec(Compiled Code)

  at netscape.debug.Debugger.launchDebugger(Compiled Code)

  at netscape.debug.Debugger.uncaughtException(Compiled Code)

  at netscape.applet.AppletThreadGroup.uncaughtException(Compiled Code)


What's the problem?

ALso, netscape's JVM has java.security package?
LVL 2
TorusAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TorusAuthor Commented:
Edited text of question.
0
heyhey_Commented:
' at java.lang.System.getProperty(Compiled Code)
  at Capture.run(Compiled Code)'


it seems that you use multiple Threads - so do you know that you have to enablePrivilege in the same Thread, before you execute the 'problematic' method.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TorusAuthor Commented:
yup. I use thread. The you mean that I need to put the enablePrivileage code in the thread?
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

TorusAuthor Commented:
I tried to put enablePrivilege("UniversalFileAccess") to the thread also. But I got error when reading file

netscape.security.AppletSecurityException: security.checkread: Codebase 'MyDir' does not include 'UserhomeDir/user.wav'

MyDir is the directory storing the class file. I tested it in local machine only without using web server.

It seems I can't read the UserhomeDir file.
0
heyhey_Commented:
> netscape.security.AppletSecurityException: security.checkread: ..

if you want to read files, you have to enable file reading too
0
TorusAuthor Commented:
but UnversialFileAccess includes read, write and delete operator, right?
0
heyhey_Commented:
can't check at the moment ...
I found these three lines of code in some old project
      netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
      netscape.security.PrivilegeManager.enablePrivilege("UniversalFileWrite");
      netscape.security.PrivilegeManager.enablePrivilege("UniversalConnect");
0
TorusAuthor Commented:
ok, I know what the problem is.
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.