amb
YaBB Newbies
Offline
Posts: 10
Re: Java Web Start problem...SOLVED
Reply #1 - Sep 28th , 2006, 1:49pm
Hi fry: Thanks for moving to right location! Ok…Thanks to a very smart co-worker, we’ve got this figured out! The problem is security related…Processing jar files must be signed to run via Java Web Start! He figured out how to turn on Error Tracing and Error Logging. [in my configuration, it is under Control Panel, Java Control Panel, Advanced tab, Debugging, check the two appropriate boxes] Please see the following URL for more details on debugging Java Web Start stuff: http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/troubleshooting.03.06.html Running my “Button.jnlp” test generates the following error messages: java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPropertyAccess(Unknown Source) at java.lang.System.getProperty(Unknown Source) at processing.core.PApplet.main(PApplet.java:5952) at Button.main(Button.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.continueLaunch(Unknown Source) at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Since processing tries to access the “user.dir”, it needs to be signed! We found more info on signing jar files at: http://wiki.jmol.org/index.php/Java_Web_Start Finally, here is the step-by-step to get a Processing sketch running via Java Web Start: 1.Open the Button example sketch in Processing IDE, save as “ButtonJWS” 2.Add the following main method: static public void main(String args[]) { PApplet.main(new String[] { "ButtonJWS" }); } // end method main... 3.Select “Save” and then “Export” 4.Copy the file “ButtonJWS.jar” to a folder that your web server can access 5.Create a “ButtonJWS.jnlp” file in the same directory containing the following lines: <?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="http://www.whatever.com" href="ButtonJWS.jnlp"> <information> <title>Testing Processing via Java Web Start</title> <vendor>processing.org</vendor> <homepage href="http://www.processing.org"/> <description>Testing Processing via Java Web Start</description> <description kind="short">Processing is an open source programming language and environment for people who want to program images, animation, and sound.</description> <offline-allowed/> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.4+"/> <jar href="ButtonJWS.jar"/> </resources> <application-desc main-class="ButtonJWS"/> </jnlp> 6.Create a new key in a new keystore with the following command: keytool -genkey -keystore myKeystore -alias myself 7.Create a self-signed test certificate as follows: keytool -selfcert -alias myself -keystore myKeystore 8.Sign the Jar file as follows: jarsigner -keystore myKeystore ButtonJWS.jar myself 9.Double click on the JNLP file you created, accept the security certificate prompt, and watch the sketch run 10.Create a simple HTML file to launch your sketch: <HTML> <A HREF="http://www.whatever.com/ButtonJWS.jnlp"> click here to test processing via web start!</A> </HTML> 11.Load that page in your favorite web browser, click the link, and watch the sketch run 12.The End.