How to create dynamically generated JNLP files post JDK-8157337?
Tim Anderson
tanderson at openvpms.org
Fri May 12 09:09:06 UTC 2017
Apologies if this is the wrong place for this post, but there doesn't
appear to be a webstart specific list.
Is it possible to generate a JNLP file with arguments that change each
invocation, and avoid the webstart security popup being displayed each time?
Background
I have a signed webstart application that is launched via a generated JNLP.
The JNLP is generated to:
* specify the codebase. The application is deployed from a .war
* supply arguments to the application, which change with each invocation
This was working fine up to Java 8 update 111. With subsequent releases,
webstart now displays a popup every time the app is run:
Do you want to run this application ?
...
This application will run with unrestricted access which may put
your computer and personal information at risk.
Run this application only if you trust the location and publisher above.
It appears to have broken since 8 update 112, when
https://bugs.openjdk.java.net/browse/JDK-8157337 was introduced.
The issue seems to be that the jnlp href is not supplied, so it
considers the app to be from multiple hosts.
I can't implement the workaround suggested at
http://stackoverflow.com/a/43716680 as the codebase is not known until
runtime.
The JNLP used for template replacement:
<jnlp spec="1.6+" codebase="$$codebase">
<information/>
<security>
<all-permissions/>
</security>
<resources>
<java version="1.6+"/>
<property name="jnlp.packEnabled" value="true"/>
<jar href="test-1.0.0.jar.jar" main="true"/>
</resources>
<application-desc main-class="org.test.Test">
<argument>$$arguments</argument>
</application-desc>
</jnlp>
The APPLICATION_TEMPLATE.JNLP
<jnlp spec="1.6+" codebase="*">
<information/>
<security>
<all-permissions/>
</security>
<resources>
<java version="1.6+"/>
<property name="jnlp.packEnabled" value="true"/>
<jar href="test-1.0.0.jar.jar" main="true"/>
</resources>
<application-desc main-class="org.test.Test">
<argument>*</argument>
</application-desc>
</jnlp>
Thanks,
-Tim
Also see:
* https://bugs.openjdk.java.net/browse/JDK-8175981
* https://bugs.openjdk.java.net/browse/JDK-8157337
*
http://stackoverflow.com/questions/42866652/the-do-you-want-to-run-this-application-prompt-is-always-displayed-for-a-dyna
More information about the core-libs-dev
mailing list