开发者

Applet failng on machines other than development machine

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. Howe开发者_JS百科ver 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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜