简体   繁体   中英

Java Deployment Rule Set not working as expected with applets

I need to create a deployment rule set which decides whether an application (webstart or applet) will be executed using Java 1.6.0_31 or 1.8.0_45. Initially I want to use 1.6.0_31 for all internally developed applications and then gradually use 1.8.0_45 for specific applications that are proven compatible with Java 8. Since all those applications are signed using our own certificate, my idea was to use this certificate as a criterion in the rule set. Here is my initial configuration:

<ruleset version="1.0+">
  <rule>
    <id title="--My Java 8 compatible application--">
        <certificate hash="--mycertificatehash--"/>
    </id>
    <action permission="run" version="1.8.0_45" force="true"/>
  </rule>
  <rule>
    <id>
        <certificate hash="--mycertificatehash--"/>
    </id>
    <action permission="run" version="1.6.0_31" force="true"/>
  </rule>
  <rule>
    <id />
    <action permission="default"/>
  </rule>
</ruleset>

For webstart applications this configuration works just as I would expect. Unfortunately I am experiencing problems when it comes to applets. When I launch an applet in the browser, an error message claims that the required Java version 1.6.0_31 is not installed. This behaviour can be reconstructed in Firefox as well as Internet Explorer. I tried my luck with "1.6", "6", "1.6*" and many more as value for the version attribute in the rule set but nothing worked. The last thing I tried was adding this rule to the top of my ruleset:

<rule>
  <id location="--myserver--"/>
  <action permission="run" version="1.6.0_31" force="true"/>
</rule>

And suddenly my applet launched and it used Java 6.

Does anybody have an idea why my initial configuration did not work for the applet? I am really trying to understand how the deployment rule set mechanisms work and what my mistake was in the initial configuration.

Two possible issues.

I noticed some irregularity with the DRS if an XML header is missing. Placing a header in the file worked for similar issues I was having.

The other thing that might cause issues is that Java documentation states the "Force" option is for versions 1.1 and greater.

" Example 28-6 Force the Use of a Specific JRE" http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/deployment_rules.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM