Forum Stats

  • 3,784,355 Users
  • 2,254,928 Discussions
  • 7,880,790 Comments

Discussions

Is it possible to run a jar-based applet in 7u51?

Harry Johnston
Harry Johnston Member Posts: 4

We have an applet which is run using HTML like this:

<APPLET CODEBASE="/bin/java" CODE="org.nzdl.gsdl.Phind.Phind.class" ARCHIVE="Phind.jar" WIDTH=500 HEIGHT=400>

As of 7u51, it no longer runs.  I've successfully signed the jar file and added the necessary root certificate, but now the runtime complains that the Permissions attribute is missing from the manifest, and I can't work out how to successfully add this attribute.

My manifest.mf file has one line

Permissions: sandbox

(There is an end-of-line; I've also tried adding an extra blank line, but this doesn't change anything.)

I'm building the jar file like this

jar cfm Phind-manifest.jar manifest.mf org

jarsigner -keystore greenstoneKey -storepass xxx -signedjar Phind-signed.jar Phind-manifest.jar greenstoneKey

(The org directory contains the class files.)

When I unpack the resulting jar file, MANIFEST.MF looks like this:

Manifest-Version: 1.0

Permissions: sandbox

Created-By: 1.7.0_51 (Oracle Corporation)

Name: org/nzdl/gsdl/Phind/Phind$SafeReader.class

SHA-256-Digest: tmCYPVEK/l3vSTLIfPR/QNzo8yUrvknHQxCFAr1KMZY=

[...]

Googling found me nothing but a bunch of other people with similar problems.  Has anybody managed to actually solve the problem, and build a jar file that Java7u51 will run as an applet?

Tagged:

Best Answer

  • Harry Johnston
    Harry Johnston Member Posts: 4
    edited Feb 6, 2014 9:14PM Accepted Answer

    After further experimentation, it doesn't look as though the problem is in the jar file; that works fine, provided that the URL to it contains a fully-qualified DNS name.  It seems that the Java runtime is unable to read the manifest properly if the URL to the jar file uses an unqualified name or an IP address.

    Addendum: the problem has now disappeared entirely.  My best guess is that the Java runtime was caching information from an earlier version of the jar file which did not have the manifest information.  If you are troubleshooting a similar problem, I suggest wiping your test account's user profile between tests.

Answers

  • Harry Johnston
    Harry Johnston Member Posts: 4
    edited Feb 6, 2014 9:14PM Accepted Answer

    After further experimentation, it doesn't look as though the problem is in the jar file; that works fine, provided that the URL to it contains a fully-qualified DNS name.  It seems that the Java runtime is unable to read the manifest properly if the URL to the jar file uses an unqualified name or an IP address.

    Addendum: the problem has now disappeared entirely.  My best guess is that the Java runtime was caching information from an earlier version of the jar file which did not have the manifest information.  If you are troubleshooting a similar problem, I suggest wiping your test account's user profile between tests.

This discussion has been closed.