简体   繁体   中英

JNLP java.security.AccessControlException with TargetDataLine.open()?

I have the following line which caused this error message run under JNLP :

java.security.AccessControlException: access denied (javax.sound.sampled.AudioPermission record)
    at java.security.AccessControlContext.checkPermission(Unknown Source)


TargetDataLine targetDataLine.open(audioFormat);

How to fix it ? Or does that mean in JNLP, we can't record sound ?

PS : I'm not running it in all-permissions mode, because it requires a 3rd party paid cert. to sign the jar before I can submit my app to Sun's Java Store. I wonder if there's any other way, like using JNLP's FileSaveService / FileOpenService ?

Frank

If you add the following to your JNLP (sibling to </infomration> , does it work?

<security>
    <all-permissions/>
</security>

By default, you do not have access outside the applet sandbox, including audio.

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