小程序在开发机器以外的机器上失败
我正在开发一个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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加 .. .. 来减少“未找到类”消息
通常可以通过向
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:
测试:当信任对话框被拒绝时:
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 ..
..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 aparam
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:
Where does the
ExitException
come from? I don't see any mention of non-Sun code in the trace, but am unfamiliar with that exactRuntimeException
.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 theJFrame
afterpack()
is called.我收到证书警告,但随后它就运行了。也许 Java 版本有问题?我有一个相当新的 1.6 版本。
I get a certificate warning, but then it runs. Maybe Java-Version problems? I have a pretty recent 1.6 version.