Note that there are some explanatory texts on larger screens.

plurals
  1. POJNLP get a permission
    text
    copied!<p>I recently stumbled across a problem when starting my application via JNLP. I now narrowed it down to a <code>java.security.AccessControlException</code>, which denies me to shut down my <code>ExecuterService</code>.</p> <p>So, I did some reading and found out that I'll need the permission (<code>modifyThread</code>) to successfully shut down the service. I also found out that I should use the <code>&lt;security&gt;</code>-tag (in the JNLP-file) to request it, but I'm a little confused about how.</p> <p>The <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/syntax.html#security" rel="nofollow">documentation of the tag</a> says:</p> <blockquote> <p>[...] If the <strong><code>all-permissions</code> element is specified, the application will have full access to the client machine and local network</strong>. If an application requests full access, then all <strong>JAR files must be signed</strong>. The <strong>user will be prompted</strong> [...]</p> </blockquote> <p>From reading this it seems to me, that I can choose to either get <em>all</em> or <em>no</em> permissions... which seems like a confusing Implementation. Because I only need the one to shutdown my service.</p> <p>I also read <a href="http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html" rel="nofollow">this article</a>, telling me that I should not request all permissions, because I would then open up the users computer for malicious code.</p> <p>So, is there a way to specify that I only need the specific permission (<code>modifyThread</code>) and I therefor don't need to sign my jar? Or will I have to go with the "sign my jar and request everything"-approach?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload