Applet security override

S

simplicity

Hi

I am getting the exception caused by
java.security.AccessControlException: access denied
(java.lang.RuntimePermission loadLibrary.<dll-name>).

I know that this is to be expected as applets generally have no access
to resources outside of the browser. After digging for the possible
solutions I found (http://java.sun.com/developer/onlineTraining/
Programming/JDCBook/appA.html) that this may actually be possible by
granting such access in the policy file.

I edited java.policy.applet file - the one which is generated and sits
in the same location as CLASS files. The modified policy file looks as
follows:

grant {
permission java.security.AllPermission; // this was generated
permission java.lang.RuntimePermission "loadLibrary.*"; // this is
added by me
}

Unfortunately, I still have the same exception. Any idea what I am
missing? Wrong policy file perhaps?

Is there another way of granting applet with access to local DLLs? I
think signed applet was another hint but could someone guide me how to
do this?
 
R

Roedy Green

I edited java.policy.applet file - the one which is generated and sits
in the same location as CLASS files. The modified policy file looks as
follows:

There are several problems with that technique.

1. Your computer may have a dozen policy files. You have to make sure
you edit the correct one.

2. You can't very well ask others to fiddle their policy files. Most
users don't even know what a file or text editor is.

3. Others in corporate environments are not permitted to modify their
policy files. That is the sole responsibility of the IT department.

see http://mindprod.com/jgloss/policyfile.html
 
A

Arne Vajhøj

I am getting the exception caused by
java.security.AccessControlException: access denied
(java.lang.RuntimePermission loadLibrary.<dll-name>).

I know that this is to be expected as applets generally have no access
to resources outside of the browser. After digging for the possible
solutions I found (http://java.sun.com/developer/onlineTraining/
Programming/JDCBook/appA.html) that this may actually be possible by
granting such access in the policy file.

I edited java.policy.applet file - the one which is generated and sits
in the same location as CLASS files. The modified policy file looks as
follows:

grant {
permission java.security.AllPermission; // this was generated
permission java.lang.RuntimePermission "loadLibrary.*"; // this is
added by me
}

Unfortunately, I still have the same exception. Any idea what I am
missing? Wrong policy file perhaps?

It seems very unlikely that the browser plugin will look for
the policy in the same dir as your class file.
Is there another way of granting applet with access to local DLLs? I
think signed applet was another hint but could someone guide me how to
do this?

I think you will be better off switching to Java Web Start.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top