Can't launch any jnlp demo with jogl !

Hello !

I’m actually developping Java games with JOGL, and I think it’s a great library and I got awesome results with great performances !

I project to make them avalaible as Java applets, so I tweaked my projects to be launch as Applets, and everything worked wonderfully in NetBeans !

I got a problem when I tried to put the applet online with JNLP ! Nothing really strange since it’s not really obvious, but I haven’t managed to make it work … The problem isn’t really here yet.

In fact I realised that I can’t run any jnlp applet using jogl ! Java3D applets run really well, etc … But I have several different errors with JOGL ones !

I tried different Java 6 update , 14, 15, 16, deleted all java and jogl files each time, cleared the Firefox cache, tried with IE7 etc …

I precise that I’m actually under Windows XP and the error I actually have in the console when trying to launch the Gears demo in an applet or not is:
https://jogl-demos.dev.java.net/applettest.html

[quote]JNLPAppletLauncher: static initializer
os.name = windows xp
nativePrefix = nativeSuffix = .dll
tmpRootDir = C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\jnlp-applet\jln5589381617654692520
Applet.init
subapplet.classname = demos.applets.GearsApplet
subapplet.displayname = JOGL Gears Applet
Applet.start
os.name = windows xp
os.arch = x86
processNativeJar: using previously cached: C:\Documents and Settings\Administrateur.jnlp-applet\cache\jogl-demos_dev_java_net\ba0d8aef2551ded250a93d393a0eb11411448c21\jogl-natives-windows-i586.jar
validateCertificates:
VALIDATE: jogl_cg.dll
java.io.IOException: Cannot find certificates for JNLPAppletLauncher class
at org.jdesktop.applet.util.JNLPAppletLauncher.checkNativeCertificates(JNLPAppletLauncher.java:1843)
at org.jdesktop.applet.util.JNLPAppletLauncher.validateCertificates(JNLPAppletLauncher.java:1814)
at org.jdesktop.applet.util.JNLPAppletLauncher.processNativeJar(JNLPAppletLauncher.java:1579)
at org.jdesktop.applet.util.JNLPAppletLauncher.initResources(JNLPAppletLauncher.java:1350)
at org.jdesktop.applet.util.JNLPAppletLauncher.initAndStartApplet(JNLPAppletLauncher.java:1254)
at org.jdesktop.applet.util.JNLPAppletLauncher.access$000(JNLPAppletLauncher.java:658)
at org.jdesktop.applet.util.JNLPAppletLauncher$1.run(JNLPAppletLauncher.java:907)
21 août 2009 19:03:20 org.jdesktop.applet.util.JNLPAppletLauncher displayError
GRAVE: java.io.IOException: Cannot find certificates for JNLPAppletLauncher class
[/quote]
Does anyone know where it come from ??

Any help will be greatly appreciated :slight_smile: Thanks :slight_smile:

P.S: I’m pretty sure it worked weeks ago, and it works perfectly on a friend computer !

ok, it works with Java 6 update 1 o_O

I’ve updated to the update 15 with the java control panel and it doesn’t work anymore !

I have anoher error I used to have:

[quote]Exception in thread “AWT-EventQueue-2” java.lang.VerifyError: (class: javax/media/opengl/awt/GLCanvas, method: chooseGraphicsConfiguration signature: (Ljavax/media/opengl/GLCapabilities;Ljavax/media/opengl/GLCapabilitiesChooser;Ljava/awt/GraphicsDevice;)Ljavax/media/nativewindow/awt/AWTGraphicsConfiguration;) Incompatible argument to function
at demos.applets.GearsApplet.init(GearsApplet.java:18)
at org.jdesktop.applet.util.JNLPAppletLauncher.startSubApplet(JNLPAppletLauncher.java:1929)
at org.jdesktop.applet.util.JNLPAppletLauncher.access$200(JNLPAppletLauncher.java:658)
at org.jdesktop.applet.util.JNLPAppletLauncher$5.run(JNLPAppletLauncher.java:1269)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
[/quote]

java.lang.VerifyError:....Incompatible argument to function...

looks like a webstart bug to me. It seems like there are still open issues with the webstart cache (switching between java versions can provoke such bugs). Cleaning the webstart cache usually solves this kind of issues - at least temporary.
(I hope you have no old jogl jars somewhere in your system folders or jre ext folders… :wink: )

I’ve deleted all jogl and java jre / jdk folders I could find and several times, and haven’t more success.

I’ve tested others jre6 updates: it works with the update 4 but not with the update 10 … Really strange !

have you actually cleared the java cache. I am not sure removing the jre changes that.

go tot he java control panel and then in the first tab. got ot the “internet files” I believe it is called.

Yes I often clear it and remove it myself by deleting the files :slight_smile:

The first error (‘java.io.IOException: Cannot find certificates for JNLPAppletLauncher class’) is because from Java 6 update 15 the JNLPAppletLoader has been blacklisted. They say at the bottom to use the current version but for me it still does not work.

However also from Java update 15 you can use JNLPs in the browser! Here is a forum post about it. So you don’t need the JNLPAppletLauncher any more.

The real issue is that you need to use both to support people who are both before and after Java 6 update 15.

Thanks, I will test it :slight_smile:

Here is some example applet code that I wrote earlier today for someone who is experiencing the same issue:

<!-- edit: the width and the height,
     and add your jars after the glugen-rt jar in archive -->
<applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
        width="800"
        height="480"
        codebase="." archive="
                http://download.java.net/media/applet-launcher/applet-launcher.jar,
                http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,
                http://download.java.net/media/gluegen/webstart/gluegen-rt.jar,
                
                MY_GAME.jar,
                MY_EXTERNAL_LIB.jar"
    
    
    <param name="codebase_lookup"       value="false">
    <param name="noddraw.check"         value="false">
    <param name="progressbar"           value="true">
    <param name="jnlpNumExtensions"     value="1">
    <param name="jnlpExtension1"        value="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp">
    <param name="noddraw.check"         value="true">
    <param name="noddraw.check.silent"  value="true">
    <param name="java_arguments"        value="-Dsun.java2d.noddraw=true">
    
    
    <!-- edit: your main class name -->
    <param name="subapplet.classname"   value="com.my_game.Main">
    <!-- edit: the title of your game -->
    <param name="subapplet.displayname" value="MY GAME">
    <!-- edit: the name of your jnlp file -->
    <param name="jnlp_href"             value="example.jnlp">
</applet>

Here is example JNLP that the applet links too.

<?xml version="1.0" encoding="utf-8"?>

<!-- edit: change the href attribute to the same name that you give to this file. -->
<jnlp href="example.jnlp">
    
    <!-- edit: generic information, edit or remove all the values except
         the update check at the bottom -->
    <information>
        <title>My Game</title>
        <vendor>Me or My company</vendor>
        <homepage href="http://www.my_homepage.com"/>
        <description>
            blah blah blah
        </description>
        <description kind="short">
            blah
        </description>
        
        <update check="background"/>
    </information>
    
    <resources>
        <j2se   version="1.6+" />
        <property
                name="sun.java2d.noddraw"
                value="true" />
                
                
        <!-- edit: have one of these for each extra jar you are importing -->
        <jar    href="MY_EXTERNAL_LIB.jar" />
        <!-- edit: the jar containing your main class -->
        <jar
                href="MY_GAME.jar"
                main="true" />
                
                
        <extension
                name = "jogl"
                href = "http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" />
    </resources>
    
    
    <!-- edit: all four details need to be changed -->
    <applet-desc 
            name       = "My Game"
            main-class = "com.myGame.Main"
            width      = "800"
            height     = "600" >
    </applet-desc>
</jnlp>

.

The comments refer to which bits you should edit for you app. If you edit them correctly then it should (hopefully) work for embedding your JOGL application in a web page.

Excellent, I’ve used your example and it works perfectly ;D Thanks a lot :wink:

[quote=“JL235,post:10,topic:34106”]
Sorry for the uber necro, but this is exactly what I need help with.

ANYWAY I’ve been trying for days to get a Jogl demo up that uses an external library, and apparently nobody knows how to do it because I’ve posted in a couple places I expected to get more feedback from. This thread got me the closest so far.

Anyway, I tried using your code, and I’m getting a weird error:

Java Plug-in 1.6.0_17
Using JRE version 1.6.0_17-b04 Java HotSpot(TM) Client VM
User home directory = D:\Student Data

MissingFieldException[ The following required field is missing from the launch file: <jnlp><information><vendor>]
	at com.sun.javaws.jnl.XMLFormat.buildInformationDesc(Unknown Source)
	at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
	at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
	at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
	at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptorFromCache(Unknown Source)
	at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptorFromCache(Unknown Source)
	at sun.plugin2.applet.JNLP2Manager.initialize(Unknown Source)
	at sun.plugin2.main.client.PluginMain.initManager(Unknown Source)
	at sun.plugin2.main.client.PluginMain.access$300(Unknown Source)
	at sun.plugin2.main.client.PluginMain$2.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Error while initializing manager: MissingFieldException[ The following required field is missing from the launch file: <jnlp><information><vendor>], bail out

Here is my applet code:

<applet code="org.jdesktop.applet.util.JNLPAppletLauncher" width="500" height="500" codebase="." archive="
 http://download.java.net/media/applet-launcher/applet-launcher.jar,
 http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,
 http://download.java.net/media/gluegen/webstart/gluegen-rt.jar,
http://www.micsworld.com/sites/default/files/MazeGame_0.jar,
http://www.micsworld.com/sites/default/files/SSG_Tools.jar">
<param name="codebase_lookup" value="false">
 <param name="noddraw.check" value="false">
 <param name="progressbar" value="true">
 <param name="jnlpNumExtensions" value="1">
 <param name="jnlpExtension1" value="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp">
 <param name="noddraw.check" value="true">
 <param name="noddraw.check.silent" value="true">
 <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
 
 <param name="subapplet.classname" value="GameRunner">
 <!-- edit: the title of your game -->
 <param name="subapplet.displayname" value="MY GAME">
 <!-- edit: the name of your jnlp file -->
 <param name="jnlp_href" value="http://www.micsworld.com/sites/default/files/MazeGame.jnlp">
</applet>

and my jnlp code:

<?xml version="1.0" encoding="utf-8"?>

<!-- edit: change the href attribute to the same name that you give to this file. -->
<jnlp href="MazeGame.jnlp">
    
    <!-- edit: generic information, edit or remove all the values except
         the update check at the bottom -->
    <information>
        <title>Jogl Maze Game</title>
	<vendor>Michael Rooney</vendor>
        <homepage href="http://www.micsworld.com"/>
        <description></description>
        <description kind="short"></description>        
        <update check="background"/>
    </information>
    
    <resources>
        <j2se   version="1.6+" />
        <property
                name="sun.java2d.noddraw"
                value="true" />
        <jar    href="SSG_Tools.jar" />
        <!-- edit: the jar containing your main class -->
        <jar
                href="MazeGame.jar"
                main="true" />
                
                
        <extension
                name = "jogl"
                href = "http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" />
    </resources>
    
    
    <!-- edit: all four details need to be changed -->
    <applet-desc 
            name       = "JOGL Maze Game"
            main-class = "GameRunner.Main"
            width      = "500"
            height     = "500" >
    </applet-desc>
</jnlp>

It looks like it’s looking for the tag, but it’s clearly there. I have no idea what the problem would be. Any help would be awesome because this is seriously starting to aggravate me :(.

I have no idea. One possible issue is that in the jnlp file you have the main-class as “GameRunner.Main”, whilst in the applet it is “GameRunner”. Bear in mind that both need to be the same in order to keep compatability with both older and newer Java versions.

Just so you know, I’ve fixed many minor issues with my jnlp that were causing the above problem. I am going to open a new thread with my new problems.