Jogl in a webstart application

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Jogl in a webstart application

Andreas
Hi,

I'm trying to use jogl in a webstart application. If I follow the hints from http://jogamp.org/wiki/index.php/Using_JOGL_in_Java_Web_Start for a local environment with local jogl-jars, I'm getting a "JAR manifest codebase mismatch for file:/....../jogl-all.jar". I'm using Oracle Java 1.7-25. What could I do?

Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Pixelapp
Try not using local jogl jars, use jnlp the way they are used in the samples instead.

Here is the my jnlp file for my game:

<?xml version="1.0" encoding="utf-8"?>
<jnlp codebase="http://wavelogy.pixelapp.co"
      href="WavelogyDesktop.jnlp">
  <information>
    <title>Wavelogy</title>
    <vendor>Pixelapp Co.</vendor>
    <homepage href="http://pixelapp.co/"/>
    <description>Wavelogy the game.</description>
    <description kind="short">Racing game.</description>
    <icon href="images/icon_128.png" width="64"
      height="64"/>
    <offline-allowed/> 
    <shortcut online="false">
    <desktop/>
    </shortcut>
  </information>
  <update check="background" policy="always"/>

      <resources>     
      <property name="sun.java2d.noddraw" value="true"/>
      <jar href="WavelogyDesktop.jar" main="true"/>
      <extension name="jogl-all-awt" href="http://jogamp.org/deployment/jogamp-current/jogl-all-awt.jnlp" />
    </resources>

  <application-desc main-class="pixelapp.wavelogy.Wavelogy">
   <argument>NotFirstUIActionOnProcess</argument> 
  </application-desc>
</jnlp>

You should modify it for your application. Also, for local application jars you should use "file:///" in the beginning of the location.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

gouessej
Administrator
In reply to this post by Andreas
PixelApp is right. You get this warning because you use JARs whose codebase written in the "Codebase" manifest attribute don't match with their real codebase. You can use the JNLP "extensions" for JOGL like PixelApp suggests or you can download unsigned JARs, modify their manifests (remove or update the "Codebase" attribute), sign them and deploy them by yourself like me. The both methods have their pros and cons, PixelApp's suggestion is easier, mine allows you to use the same certificate to sign all dependencies and your own JARs and to have a greater control on which build you use, where the end users get it, etc... In my case I don't enable Pack200 because I found it not reliable enough and the speedup was not obvious in many cases.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Andreas
Thanks for the hints. I tried this before, but at first it didn't work. I found out that this was caused by the local jogl-jars in the lib folder. I removed them an now it's working locally. But it does not on the server. I'm getting the following errors with the given jnlp file on a linux 64 bit machine (Windows seems to work):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp spec="1.0+" codebase="http://tu-dresden.de/die_tu_dresden/fakultaeten/fakultaet_maschinenwesen/ilr/aero/download/laminatetheory" href="laminatetheory_de.jnlp">
    <information>
        <title>eLamX</title>
        <vendor>Lehrstuhl für Luftfahrzeugtechnik - TU Dresden</vendor>
        <description>expandable Laminate eXplorer</description>
        <description kind="short">expandable Laminate eXplorer</description>
        <homepage href="http://tu-dresden.de/mw/ilr/lft"/>
        <offline-allowed/>
    </information>
    <security> 
      <all-permissions/> 
    </security>
    <resources>
        <property name="user.language" value="de"/>
        <j2se version="1.6+" java-vm-args="-Duser.language=de"/>
        <jar href="http://web.tu-dresden.de/lft/laminatetheory/LaminateTheory.jar" main="true" download="eager"/>
        <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/LT_Laminate.jar" download="eager"/>
        <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/LT_Calculation.jar" download="eager"/>
        <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/LT_Buckling.jar" download="eager"/>
        <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/LT_Deformation.jar" download="eager"/>
        <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/LT_WWFE.jar" download="eager"/>
        <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/LT_Failure.jar" download="eager"/>
        <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/LFTSwing.jar" download="eager"/>
    <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/j3dcore.jar" download="eager"/>
    <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/j3dutils.jar" download="eager"/>
    <jar href="http://web.tu-dresden.de/lft/laminatetheory/lib/vecmath.jar" download="eager"/>
        <extension name="jogl-all-awt" href="http://jogamp.org/deployment/jogamp-current/jogl-all-awt.jnlp" />
    </resources>
    <application-desc main-class="laminatetheory.Main">
    </application-desc>
</jnlp>


Missing Codebase manifest attribute for: http://jogamp.org/deployment/archive/rc/v2.0.2-rc12/jar/gluegen-rt.jar
JNLPClassLoader: Finding library libjawt.so
JNLPClassLoader: Finding library libjawt.so
JNLPClassLoader: Finding library liblibGL.so.1.so
JNLPClassLoader: Finding library liblibGLESv1_CM.so.2.so
JNLPClassLoader: Finding library liblibGLESv1_CM.so.so
JNLPClassLoader: Finding library libGLESv1_CM.so
JNLPClassLoader: Finding library libGLES_CM.so
JNLPClassLoader: Finding library libGLES_CL.so
JNLPClassLoader: Finding library liblibGLESv1_CM.so
JNLPClassLoader: Finding library liblibGLES_CM.so
JNLPClassLoader: Finding library liblibGLES_CL.so
JNLPClassLoader: Finding library liblibEGL.so.1.so
JNLPClassLoader: Finding library liblibGLESv2.so.2.so
JNLPClassLoader: Finding library liblibEGL.so.1.so
java.lang.NullPointerException
        at com.sun.deploy.cache.DeployCacheHandler.get(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
        at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:214)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:71)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:73)
        at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
        at com.sun.jnlp.JNLPCachedJarURLConnection.connect(Unknown Source)
        at com.sun.jnlp.JNLPCachedJarURLConnection.getJarFile(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(URLClassLoader.java:358)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(X11AWTGraphicsConfigurationFactory.java:92)
        at jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(X11AWTGraphicsConfigurationFactory.java:80)
        at javax.media.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:420)
        at javax.media.j3d.JoglPipeline.getAWTGraphicsConfiguration(JoglPipeline.java:8295)
        at javax.media.j3d.JoglPipeline.getBestConfiguration(JoglPipeline.java:8212)
        at javax.media.j3d.Renderer.doWork(Renderer.java:494)
        at javax.media.j3d.J3dThread.run(J3dThread.java:270)
java.lang.NullPointerException
        at com.sun.deploy.cache.DeployCacheHandler.get(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:876)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
        at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:214)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:71)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:73)
        at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
        at com.sun.jnlp.JNLPCachedJarURLConnection.connect(Unknown Source)
        at com.sun.jnlp.JNLPCachedJarURLConnection.getJarFile(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(URLClassLoader.java:358)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(X11AWTGraphicsConfigurationFactory.java:92)
        at jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(X11AWTGraphicsConfigurationFactory.java:80)
        at javax.media.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:420)
        at javax.media.j3d.JoglPipeline.getAWTGraphicsConfiguration(JoglPipeline.java:8295)
        at javax.media.j3d.JoglPipeline.getBestConfiguration(JoglPipeline.java:8212)
        at javax.media.j3d.Renderer.doWork(Renderer.java:494)
        at javax.media.j3d.J3dThread.run(J3dThread.java:270)
GraphicsConfiguration for Java3D is null!
Jul 19, 2013 11:29:17 AM laminatetheory.gui.LaminateTheory loadModule
SEVERE: null
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at laminatetheory.gui.LaminateTheory.loadModule(LaminateTheory.java:322)
        at laminatetheory.gui.LaminateTheory.access$500(LaminateTheory.java:68)
        at laminatetheory.gui.LaminateTheory$ModuleActionListener.actionPerformed(LaminateTheory.java:522)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
        at java.awt.Component.processMouseEvent(Component.java:6505)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
        at java.awt.Component.processEvent(Component.java:6270)
        at java.awt.Container.processEvent(Container.java:2229)
        at java.awt.Component.dispatchEventImpl(Component.java:4861)
        at java.awt.Container.dispatchEventImpl(Container.java:2287)
        at java.awt.Component.dispatchEvent(Component.java:4687)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
        at java.awt.Container.dispatchEventImpl(Container.java:2273)
        at java.awt.Window.dispatchEventImpl(Window.java:2719)
        at java.awt.Component.dispatchEvent(Component.java:4687)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
        at java.awt.EventQueue.access$200(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:694)
        at java.awt.EventQueue$3.run(EventQueue.java:692)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.awt.EventQueue$4.run(EventQueue.java:708)
        at java.awt.EventQueue$4.run(EventQueue.java:706)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.NullPointerException: Canvas3D: null GraphicsConfiguration
        at javax.media.j3d.Canvas3D.checkForValidGraphicsConfig(Canvas3D.java:948)
        at javax.media.j3d.Canvas3D.<init>(Canvas3D.java:991)
        at LT_Failure.GUI.View3D.createCanvas(View3D.java:78)
        at LT_Failure.GUI.View3D.<init>(View3D.java:62)
        at LT_Failure.GUI.LT_FailureDialog.<init>(LT_FailureDialog.java:105)
        ... 44 more
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Pixelapp
If your this works on other machines, then you should not worry about the JNLP file.

But I guess/see that the error is because Java 3D is not supported in your machine yet. Maybe because of software needed or hardware needed. I deduct that from the following line.

"Caused by: java.lang.NullPointerException: Canvas3D: null GraphicsConfiguration "

Edit: Have you tried running a sample Java 3D application on your Linux machine that works? That should help you debug this problem.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Andreas
But I don't understand why it is working if the jars of my application (including the Java3D-jars) are located on the locale machine and not if they are on the server. Both tested on the same machine with webstart and the jogl include over the jogl jnlp file.

Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

gouessej
Administrator
It should work under GNU Linux. When I initiated the port of Java3D to JOGL 2.0, I was under GNU Linux 32 bits. Which version of Java do you use under Linux? I use OpenJDK 1.6, you seem to use Oracle Java :s

Edit.: Your problem seems to come from the retrieval of a resource, maybe a bad path separator or something similar, it would explain why it works locally and under Windows. Your problem has nothing to do with Java3D but the first NullPointerException makes it crash.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Pixelapp
In reply to this post by Andreas
If they work on your machine but not on the server then your problem is definitely your JNLP file.

The proper way to set up your JNLP file last time I check is

mywebsitefolder
  -myapplication.jnlp
  -myapplicationjar1.jar
  -myapplicationjar2.jar

Also, please try using an already working JNLP file from one of the samples. That should help you.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Andreas
I'm using OpenSuSE 12.3 with Oracle JDK 64bit. In this case it does not work and throw the error. If I use OpenJDK Runtime Environment (IcedTea 2.3.9) (suse-8.14.5-x86_64)/OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode) everything works fine. So it seems to be a problem of the Oracle JDK.

Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

gouessej
Administrator
Do you use JavaFX?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Andreas
No. Pur Java.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

gouessej
Administrator
Do you reproduce this bug when you're under Fedora with Oracle Java but without Java Web Start? It would be fine to create a tiny test case and to report the bug against Java itself if it comes from it.

Edit.: Please can you try to reproduce your bug with a rudimentary example showing just a triangle?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Andreas
If you mean OpenSuSE it is working without webstart. So the error happens only if I use webstart with Oracle Java. I try to create a test case over the weekend.

Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

gouessej
Administrator
Sorry I meant OpenSuse. I already saw a similar stack trace several times under OpenSuse but the persons who were concerned never spent some time in providing a small test case. I advise you to use the small pure JOGL example I posted on Wikipedia in order to check whether the bug concerns Java3D or JOGL.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

gouessej
Administrator
This post was updated on .
In reply to this post by Andreas
Maybe the bug comes from this class:
https://github.com/sgothel/jogl/blob/master/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
but I don't understand why it works without Java Web Start. Are you sure that all JARs are signed? Is the "Permissions" manifest attribute correctly set?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Andreas
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
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

gouessej
Administrator
Try to sign all JARs with the same certificate, update all manifests ("Permissions" and "Codebase" attributes) to avoid scary useless security warnings. All JARs directly mentioned in a JNLP file must use the same certificate and the "codebase" field of this file must have the same value than the "Codebase" attribute in the manifests. "Permissions" must be set to "all-permissions".
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Andreas
I tried the hole day to get it work. I found the reason why it worked on windows. I forgot to update to Oracle Java 1.7 Update 25. Now it is not working on windows and linux ;-)

I changed the manifest of all jar file (my application, java3d, jogl, gluegen). So there is everywhere a:
Codebase: *
Permissions: all-permission

All jars are in one jnlp file and all Warnings (Codebase, Permissions) are gone.

It is working locally but not from the server.

I'm getting the following from Linux:

Log started: Mo, 22 Jul 2013 17:00:09 +0200
Java Web Start 10.25.2.15
JRE-Version verwenden
 1.7.0_25-b15 Java HotSpot(TM) 64-Bit Server VM
No user *.properties file found.
3D [dev] 1.6.0-pre7-daily-experimental daily

JNLPClassLoader: Finding library libjawt.so
JNLPClassLoader: Finding library libjawt.so
JNLPClassLoader: Finding library liblibGL.so.1.so
JNLPClassLoader: Finding library liblibGLESv1_CM.so.2.so
JNLPClassLoader: Finding library liblibGLESv1_CM.so.so
JNLPClassLoader: Finding library libGLESv1_CM.so
JNLPClassLoader: Finding library libGLES_CM.so
JNLPClassLoader: Finding library libGLES_CL.so
JNLPClassLoader: Finding library liblibGLESv1_CM.so
JNLPClassLoader: Finding library liblibGLES_CM.so
JNLPClassLoader: Finding library liblibGLES_CL.so
JNLPClassLoader: Finding library liblibEGL.so.1.so
JNLPClassLoader: Finding library liblibGLESv2.so.2.so
JNLPClassLoader: Finding library liblibEGL.so.1.so
java.lang.IllegalArgumentException: java.lang.NullPointerException
        at jogamp.nativewindow.NativeWindowFactoryImpl.getAWTNativeWindow(NativeWindowFactoryImpl.java:99)



And this error log from Windows:

Log started: Mo, 22 Jul 2013 17:03:38 +0200
Java Web Start 10.25.2.17
JRE-Version verwenden
 1.7.0_25-b17 Java HotSpot(TM) Client VM
No user *.properties file found.
3D [dev] 1.6.0-pre7-daily-experimental daily

JNLPClassLoader: Finding library jawt.dll
JNLPClassLoader: Finding library jawt.dll
JNLPClassLoader: Finding library OpenGL32.dll
JNLPClassLoader: Finding library libGLESv1_CM.so.2.dll
JNLPClassLoader: Finding library libGLESv1_CM.so.dll
JNLPClassLoader: Finding library GLESv1_CM.dll
JNLPClassLoader: Finding library GLES_CM.dll
JNLPClassLoader: Finding library GLES_CL.dll
JNLPClassLoader: Finding library libGLESv1_CM.dll
JNLPClassLoader: Finding library libGLES_CM.dll
JNLPClassLoader: Finding library libGLES_CL.dll
JNLPClassLoader: Finding library libEGL.so.1.dll
JNLPClassLoader: Finding library libEGL.so.dll
JNLPClassLoader: Finding library EGL.dll
JNLPClassLoader: Finding library libEGL.dll
JNLPClassLoader: Finding library libGLESv2.so.2.dll
JNLPClassLoader: Finding library libGLESv2.so.dll
JNLPClassLoader: Finding library GLESv2.dll
JNLPClassLoader: Finding library GLES20.dll
JNLPClassLoader: Finding library GLESv2_CM.dll
JNLPClassLoader: Finding library libGLESv2.dll
JNLPClassLoader: Finding library libGLESv2_CM.dll
JNLPClassLoader: Finding library libGLES20.dll
JNLPClassLoader: Finding library libEGL.so.1.dll
JNLPClassLoader: Finding library libEGL.so.dll
JNLPClassLoader: Finding library EGL.dll
JNLPClassLoader: Finding library libEGL.dll
java.lang.IllegalArgumentException: java.lang.NullPointerException
        at jogamp.nativewindow.NativeWindowFactoryImpl.getAWTNativeWindow(NativeWindowFactoryImpl.java:99)
        at jogamp.nativewindow.NativeWindowFactoryImpl.getNativeWindowImpl(NativeWindowFactoryImpl.java:65)
        at javax.media.nativewindow.NativeWindowFactory.getNativeWindow(NativeWindowFactory.java:566)
        at javax.media.j3d.JoglPipeline.createNewContext(JoglPipeline.java:6279)
        at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4608)
        at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2379)
        at javax.media.j3d.Renderer.doWork(Renderer.java:879)
        at javax.media.j3d.J3dThread.run(J3dThread.java:270)
Caused by: java.lang.NullPointerException
        at com.sun.deploy.cache.DeployCacheHandler.get(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
        at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
        at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
        at com.sun.jnlp.JNLPCachedJarURLConnection.connect(Unknown Source)
        at com.sun.jnlp.JNLPCachedJarURLConnection.getJarFile(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.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(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.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(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.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at com.jogamp.common.util.ReflectionUtil.getClassImpl(ReflectionUtil.java:81)
        at com.jogamp.common.util.ReflectionUtil.getConstructor(ReflectionUtil.java:90)
        at jogamp.nativewindow.NativeWindowFactoryImpl.getAWTNativeWindow(NativeWindowFactoryImpl.java:95)
        ... 7 more

DefaultRenderingErrorListener.errorOccurred:
CONTEXT_CREATION_ERROR: Renderer: Error creating Canvas3D graphics context
graphicsDevice = D3DGraphicsDevice[screen=0]
canvas = javax.media.j3d.Canvas3D[canvas0,0,0,900x400]
GLDrawableFactory.shutdownImpl: Catched java.lang.IllegalStateException during factory shutdown #2/2 jogamp.opengl.egl.EGLDrawableFactory

Now it opens the 3DView very short and then closes the application.
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

gouessej
Administrator
Have you put that into your JNLP file?
<security> 
        <all-permissions />
</security>

Please can you try other online demos using JOGL 2.0 & AWT? Maybe something breaks AWT support in JOGL as I thought.

Edit.: there is another problem, look at your last lines, Direct3D device screens should never be pickep up. Please disable the Direct3D pipeline. I do that (the 2 first ones are very important):
<property name="sun.java2d.noddraw" value="true"/>
<property name="sun.java2d.d3d" value="false"/>
<property name="sun.java2d.opengl" value="false"/>
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jogl in a webstart application

Andreas
Hi,

I had the security tag in the jnlp file. It seems that after the update from JOGL 2.0.2 RC12 to JOGL 2.0.2 the error is gone. Now I can use the application from Windows and Linux with Oracle JDK/JRE. I added the three lines to my jnlp file disable Direct3D.

Thanks for your help.

Andreas
12