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

发布于 2024-08-20 16:16:42 字数 475 浏览 4 评论 0原文

我有以下行导致在 JNLP 下运行此错误消息:

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


TargetDataLine targetDataLine.open(audioFormat);

如何修复它?或者这是否意味着在 JNLP 中我们无法录制声音?

PS:我没有在所有权限模式下运行它,因为它需要第三方付费证书。在我可以将我的应用程序提交到 Sun 的 Java Store 之前对 jar 进行签名。我想知道是否还有其他方法,例如使用 JNLP 的 FileSaveService / FileOpenService ?

坦率

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

給妳壹絲溫柔 2024-08-27 16:16:42

如果您将以下内容添加到您的 JNLP(与同级),它可以工作吗?

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

默认情况下,您没有小程序沙箱之外的访问权限,包括音频。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文