Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java 7: Problems launching applets with jars on "file://" location

joan_esteveJun 2 2014 — edited Jun 14 2014

Hi,

We are experiencing a problem when updating our client's JRE from Java6 U 21 up to Java7 U 55.

We have developed an Applet which is composed by several JAR files. Some of those JARs must be stored in local drive, and the JAR with the main Java class is stored on server.

Let's supose we have a similar scenario like this:

https://blahblahbah/bar.jar

https://blahblahbah/test.html

C:/foo.jar

The code of test.html:

<embed

  archive="file:///C:/foo.jar"

  cache_archive="bar.jar"

  ...

/>

This code works fine on Java 6 and Applet is correctly loaded.

However, with Java 7 a security exception is raised when trying to load JAR files from "file:///" location during Applet launch:

java.lang.SecurityException: Permission denied: file:/C:/foo.jar

    at sun.plugin2.applet.Applet2Manager._loadJarFiles(Unknown Source)

We have tried several tests using a java.policy file which grants all possible permisions:

grant codeBase "file:/C:/foo.jar" {

    permission java.security.AllPermission;

};

grant {

  permission java.security.AllPermission;

};

We also tried to low Java's security level to "MEDIUM", with no success.

We finally only managed to run the Applet if we explicity disable the "Next-Generation Plugin" with Internet Explorer 8. However, that's not a suitable solution, and still does not work with Mozilla family browsers.

Eventhought with Mozilla browsers is still not working.

Is there any restrictions in Java 7 that prevents to read jars from being loaded from local drive when launching Applets?

Thanks in advance,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2014
Added on Jun 2 2014
5 comments
7,524 views