Posted by
Andreas on
Jul 20, 2013; 7:27pm
URL: https://forum.jogamp.org/Jogl-in-a-webstart-application-tp4029613p4029631.html
Hi,
at home I'm even not able to get it working on a Windows machine. I used a very small example created in Netbeans 7.3.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package jogl.webstart;
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.SimpleUniverse;
import java.awt.BorderLayout;
import java.awt.GraphicsConfiguration;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.Canvas3D;
import javax.swing.JFrame;
/**
*
* @author Corina
*/
public class JOGLWebstart extends JFrame {
public JOGLWebstart() {
GraphicsConfiguration config = SimpleUniverse
.getPreferredConfiguration();
Canvas3D canvas3D = new Canvas3D(config);
BranchGroup scene = createSceneGraph();
scene.compile();
// SimpleUniverse is a Convenience Utility class
SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
// This moves the ViewPlatform back a bit so the
// objects in the scene can be viewed.
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.addBranchGraph(scene);
getContentPane().add(canvas3D,BorderLayout.CENTER);
} // end of HelloJava3D (constructor)
public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();
// Create a simple shape leaf node, add it to the scene graph.
// ColorCube is a Convenience Utility class
objRoot.addChild(new ColorCube(0.4));
return objRoot;
} // end of createSceneGraph method of HelloJava3D
public static void main(String[] args){
JFrame frame=new JOGLWebstart();
frame.setTitle("Hello Java3D");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(0,0,400,300);
frame.setVisible(true);
}
}
This is the jnlp file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp href="launch.jnlp" spec="1.0+">
<information>
<title>JOGL-Webstart</title>
<vendor>Corina</vendor>
<homepage href=""/>
<description>JOGL-Webstart</description>
<description kind="short">JOGL-Webstart</description>
<offline-allowed/>
</information>
<update check="background"/>
<resources>
<j2se version="1.7+"/>
<jar href="JOGL-Webstart.jar" main="true"/>
<jar href="lib/j3dcore.jar"/>
<jar href="lib/j3dutils.jar"/>
<jar href="lib/vecmath.jar"/>
<extension href="
http://jogamp.org/deployment/jogamp-current/jogl-all-awt.jnlp" name="" version=""/>
</resources>
<application-desc main-class="jogl.webstart.JOGLWebstart">
</application-desc>
</jnlp>
If I run the jnlp locally and use an unsigned jar of this small application with the online JOGL and set the security level of Oracle Java 1.7 Update 25 to middle I'm getting the following error:
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
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.checkAccess(Unknown Source)
at java.lang.ThreadGroup.checkAccess(Unknown Source)
at java.lang.ThreadGroup.getParent(Unknown Source)
at javax.media.j3d.MasterControl$16.run(MasterControl.java:3473)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.j3d.MasterControl.<clinit>(MasterControl.java:3466)
at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:221)
at jogl.webstart.JOGLWebstart.<init>(JOGLWebstart.java:21)
at jogl.webstart.JOGLWebstart.main(JOGLWebstart.java:52)
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.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
If I generate a self-signed jar with netbeans and run it locally I'm getting the following error:
Exception in thread "J3D-MasterControl-1" java.lang.NullPointerException
at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
at com.sun.javaws.security.AppPolicy.addPermissions(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.getTrustedCodeSources(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at javax.media.j3d.Renderer.<init>(Renderer.java:85)
at javax.media.j3d.MasterControl$8.run(MasterControl.java:976)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.j3d.MasterControl.createRenderer(MasterControl.java:971)
at javax.media.j3d.MasterControl.sendRenderMessage(MasterControl.java:2741)
at javax.media.j3d.MasterControl.handlePendingRequest(MasterControl.java:3038)
at javax.media.j3d.MasterControl.doWork(MasterControl.java:2877)
at javax.media.j3d.MasterControlThread.run(MasterControlThread.java:62)
Could it be a Problem to use online jogl with selfsigned Java3D-jars?
Andreas