views:

231

answers:

1

I have a signed Java applet. And it works fine. But now I have to integrate some 3rd party JAR files with it. When I test it from Eclipse, the whole thing works correctly. But when I test it as an applet, it gives me a java.security.AccessControlException: access denied (java.io.FilePermission ...)

I thought this was because those 3rd party JAR files don't have a java.policy.applet within them. But manually adding the policy file doesn't get rid of the error.

What am I missing? Thanks!

============================

All the 3rd party JAR files sit on the server filesystem like so: A.jar, B.jar, C.jar. And I include them in the applet tag like so:

<applet
    archive="my.jar,A.jar,B.jar,C.jar">
</applet>

Also, in the MANIFEST/MANIFEST.MF file in my.jar, I include those JAR files like so:

Class-Path: A.jar,B.jar,C.jar
+2  A: 

You have to sign these jars as well, if they are attempting restricted operations.

Bozho
thanks much! it works now!!
sri
Also note that since 6u19 (the current secure release of Java SE 6 at the time of writing) users will typically get a warning earlier: http://java.sun.com/javase/6/docs/technotes/guides/jweb/mixed_code.html / I have to make my usual comment that you really should know what you are doing before signing code.
Tom Hawtin - tackline