小程序在开发机器以外的机器上失败

发布于 2024-10-31 15:10:30 字数 576 浏览 1 评论 0原文

我正在开发一个Java小程序,最近我试图在一台不属于我的机器上演示该小程序。然而,我无法让小程序在该机器上运行,因为它一直因安全异常而失败。该小程序可以在 http://www.cs.rpi.edu/~madiav 找到/launch.html

遗憾的是,我无法访问另一台机器来收集堆栈跟踪或 Java 控制台的输出。然而,我注意到我的计算机上的 Java 控制台会发出大量与未找到类相关的消息,但是 appet 仍然按预期运行,因此我忽略了它们。

Java 控制台的完整输出可以在这里找到 http://pastebin.com/DjFAJgVW 类未找到类型的示例行是

basic: JNLP2ClassLoader.findClass: RhythmWheels.Open: try again ..

有谁知道我如何摆脱这些和/或这是否是导致其他计算机上执行失败的原因?

I'm developing a Java applet, and recently I tried to demonstrate the applet on a machine that did not belong to me. However I was unable to get the applet to run on that machine, as it kept failing with security exceptions. The applet can be found at http://www.cs.rpi.edu/~madiav/launch.html.

Sadly I do not have access to this other machine to collect a stack trace or the output from the Java console. However I have noticed that the Java console on my computer spits out a lot of messages relating to classes not being found, however the appet still ran as expected so I ignored them.

The entire output from the Java console can be found here http://pastebin.com/DjFAJgVW
An example line of the class not found type is

basic: JNLP2ClassLoader.findClass: RhythmWheels.Open: try again ..

Does anyone know how I can get rid of these and/or whether this is what is causing execution to fail on other machines?

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

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

发布评论

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

评论(2

不忘初心 2024-11-07 15:10:30

添加 .. .. 来减少“未找到类”消息

<param name='codebase_lookup' value='false'> 

通常可以通过向applet 元素 。至少如果课程是Jar'd的话。

请参阅特殊 Applet 属性了解细节。


注意:这是HTML中的小程序param不是JNLP文件<中的param /强>。


让您的朋友报告 java.version & java.vendor 属性


Applet 只能通过 Sun 1.6.0_10+ 的 JNLP 进行配置。即使这样,浏览器也需要专门配置才能在 Linux 上使用“下一代”插件。最好(至少在测试时)在 HTML 的小程序元素中放置一个完全不同的小程序(与 JNLP 中指定的小程序不同),以帮助判断是否获得“下一代”。 /plug-in2'行为。


编辑2:

测试:当信任对话框被拒绝时:

exception: exit(-1).
ExitException[ 4]java.lang.RuntimeException: exit(-1)
    at com.sun.javaws.Main.systemExit(Unknown Source)
    at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
    at com.sun.javaws.LaunchDownload.checkSignedResourcesHelper(Unknown Source)
    at com.sun.javaws.LaunchDownload.checkSignedResources(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Exception: ExitException[ 4]java.lang.RuntimeException: exit(-1)

ExitException 从何而来?我在跟踪中没有看到任何非 Sun 代码的提及,但我不熟悉确切的 RuntimeException

确保框架不会尝试调用 JFrame.EXIT_ON_CLOSE。即使是受信任的小程序也不允许结束当前的 VM 实例。我想出了如何“解决”这个问题并尝试过 - 看到整个浏览器崩溃了。 ;)

测试:当信任对话框确定时:

小程序运行并生成一个按钮来弹出自由浮动的“混合器”。按钮可以发出声音,但无法从那里找出声音。


为什么这个小程序需要信任?


放弃小程序并让 JNLP 直接启动 JFrame 可能会更好。

由于您似乎期望最终用户拥有 1.6.0(_10+),因此在 pack() 之后调用 JFrame 上的 setMinimumSize() 也是值得的 被调用。

The 'class not found' messages can usually be reduced by adding ..

<param name='codebase_lookup' value='false'> 

..to the applet element. At least if the classes are Jar'd.

See Special Applet Attributes for details.


Note: This is an applet param in the HTML, not a param in the JNLP file.


Get your friend to report back the java.version & java.vendor properties.


Applets can only be configured by JNLP from Sun's 1.6.0_10+. Even then the browser needed to be specifically configured to use the 'next generation' plug-in on Linux. It is best (when testing, at least) to put an entirely different applet in the applet element in HTML (to the one specified in JNLP), to help tell if getting the 'next gen. / plug-in2' behavior.


Edit 2:

Testing: When the trust dialog is refused:

exception: exit(-1).
ExitException[ 4]java.lang.RuntimeException: exit(-1)
    at com.sun.javaws.Main.systemExit(Unknown Source)
    at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
    at com.sun.javaws.LaunchDownload.checkSignedResourcesHelper(Unknown Source)
    at com.sun.javaws.LaunchDownload.checkSignedResources(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Exception: ExitException[ 4]java.lang.RuntimeException: exit(-1)

Where does the ExitException come from? I don't see any mention of non-Sun code in the trace, but am unfamiliar with that exact RuntimeException.

Make sure the frame does not attempt to call JFrame.EXIT_ON_CLOSE. Not even a trusted applet is allowed to end the current VM instance. I figured how to 'get around' that once and tried it - to see the entire browser crash. ;)

Testing: When the trust dialog is OK'd:

Applet runs and produces a button to pop the free-floating 'mixer'. Buttons can make sound but could not figure it from there.


Why exactly does this applet need trust?


It would probably be better to dispense with the applet and have the JNLP launch the JFrame directly.

Since you seem to expect the end user to have 1.6.0(_10+), it would also be worthwhile calling setMinimumSize() on the JFrame after pack() is called.

踏月而来 2024-11-07 15:10:30

但是,我无法让小程序在该计算机上运行,​​因为它一直因安全异常而失败。

我收到证书警告,但随后它就运行了。也许 Java 版本有问题?我有一个相当新的 1.6 版本。

However I was unable to get the applet to run on that machine, as it kept failing with security exceptions.

I get a certificate warning, but then it runs. Maybe Java-Version problems? I have a pretty recent 1.6 version.

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