not happy with jnlp

http://download.java.net/media/jogl/demos/www/applettest-joal.html

if java’s own demo doesn’t work… ( sound does not play )
how the hell are we meant to take this stuff seriously.
Unhappy camper

Guess it’s time to revert to some more basic sounds…

Have a go with LWJGL instead.

Cas :slight_smile:

No it is time to fix this bug. What is wrong? Can you display the console? Do you have an exception? It does not work on my computer because I have forgotten to erase old GlueGen and JOGL JARs:

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

just for the record: JOGL2 hasn’t been released yet.


Java Plug-in 1.6.0_16
Using JRE version 1.6.0_16-b01 Java HotSpot(TM) Client VM
User home directory = /home/mbien

----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------

JNLPAppletLauncher: static initializer
os.name = linux
nativePrefix = lib  nativeSuffix = .so
tmpRootDir = /tmp/jnlp-applet/jln3654071058749269419
Applet.init
subapplet.classname = demos.applets.GearsJOALApplet
subapplet.displayname = JOGL / JOAL Gears Applet
Applet.start
os.name = linux
os.arch = i386
processNativeJar: http://download.java.net/media/jogl/jsr-231-2.x-webstart/nativewindow-natives-linux-i586.jar --> /home/mbien/.jnlp-applet/cache/download_java_net/5334ca2411591050da5d9b1da2f03bfbf76afedc/nativewindow-natives-linux-i586.jar : 16066 bytes written
validateCertificates:
VALIDATE: libnativewindow_awt.so
VALIDATE: libnativewindow_jvm.so
VALIDATE: libnativewindow_x11.so
extractNativeLibs:
EXTRACT: libnativewindow_awt.so(nativewindow_awt)
EXTRACT: libnativewindow_jvm.so(nativewindow_jvm)
EXTRACT: libnativewindow_x11.so(nativewindow_x11)
processNativeJar: http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-natives-linux-i586.jar --> /home/mbien/.jnlp-applet/cache/download_java_net/5334ca2411591050da5d9b1da2f03bfbf76afedc/jogl-natives-linux-i586.jar : 338820 bytes written
validateCertificates:
VALIDATE: libjogl_cg.so
VALIDATE: libjogl_es1.so
VALIDATE: libjogl_es2.so
VALIDATE: libjogl_gl2.so
VALIDATE: libjogl_gl2es12.so
extractNativeLibs:
EXTRACT: libjogl_cg.so(jogl_cg)
EXTRACT: libjogl_es1.so(jogl_es1)
EXTRACT: libjogl_es2.so(jogl_es2)
EXTRACT: libjogl_gl2.so(jogl_gl2)
EXTRACT: libjogl_gl2es12.so(jogl_gl2es12)
processNativeJar: http://download.java.net/media/gluegen/webstart/gluegen-rt-natives-linux-i586.jar --> /home/mbien/.jnlp-applet/cache/download_java_net/5334ca2411591050da5d9b1da2f03bfbf76afedc/gluegen-rt-natives-linux-i586.jar : 6892 bytes written
validateCertificates:
VALIDATE: libgluegen-rt.so
extractNativeLibs:
EXTRACT: libgluegen-rt.so(gluegen-rt)
processNativeJar: http://download.java.net/media/joal/webstart/joal-natives-linux-i586.jar --> /home/mbien/.jnlp-applet/cache/download_java_net/5334ca2411591050da5d9b1da2f03bfbf76afedc/joal-natives-linux-i586.jar : 313159 bytes written
validateCertificates:
VALIDATE: libjoal_native.so
VALIDATE: libopenal.so
extractNativeLibs:
EXTRACT: libjoal_native.so(joal_native)
EXTRACT: libopenal.so(openal)
processNativeJar: http://download.java.net/media/gluegen/webstart-2.x/gluegen-rt-natives-linux-i586.jar --> /home/mbien/.jnlp-applet/cache/download_java_net/5334ca2411591050da5d9b1da2f03bfbf76afedc/gluegen-rt-natives-linux-i586.jar : 6961 bytes written
validateCertificates:
VALIDATE: libgluegen-rt.so
extractNativeLibs:
EXTRACT: libgluegen-rt.so(gluegen-rt)
JNLPAppletLauncher.loadLibrary("nativewindow_jvm")
    loading: /tmp/jnlp-applet/jln3654071058749269419/jln8796604995956323529/libnativewindow_jvm.so
JNLPAppletLauncher.loadLibrary("gluegen-rt")
    loading: /tmp/jnlp-applet/jln3654071058749269419/jln8796604995956323529/libgluegen-rt.so
JNLPAppletLauncher.loadLibrary("nativewindow_x11")
    loading: /tmp/jnlp-applet/jln3654071058749269419/jln8796604995956323529/libnativewindow_x11.so
JNLPAppletLauncher.loadLibrary("jogl_gl2")
    loading: /tmp/jnlp-applet/jln3654071058749269419/jln8796604995956323529/libjogl_gl2.so
JNLPAppletLauncher.loadLibrary("jogl_gl2es12")
    loading: /tmp/jnlp-applet/jln3654071058749269419/jln8796604995956323529/libjogl_gl2es12.so
JNLPAppletLauncher.loadLibrary("nativewindow_awt")
    loading: /tmp/jnlp-applet/jln3654071058749269419/jln8796604995956323529/libnativewindow_awt.so
INIT GL IS: com.sun.opengl.impl.gl2.GL2Impl
Chosen GLCapabilities: GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 8, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: false, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: false, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]
GL_VENDOR: DRI R300 Project
GL_RENDERER: Mesa DRI R300 20060815 x86/MMX/SSE2 TCL
GL_VERSION: 1.3 Mesa 7.4
JNLPAppletLauncher.loadLibrary("joal_native")
    loading: /tmp/jnlp-applet/jln3654071058749269419/jln8796604995956323529/libjoal_native.so
Exception in thread "AWT-EventQueue-1" java.lang.RuntimeException: Can not get proc address for method "alcCaptureCloseDevice": Couldn't set value of field "_addressof_alcCaptureCloseDevice" in class net.java.games.joal.impl.ALCProcAddressTable
	at com.sun.gluegen.runtime.ProcAddressHelper.resetProcAddressTable(ProcAddressHelper.java:113)
	at net.java.games.joal.impl.ALProcAddressLookup.resetALCProcAddressTable(ALProcAddressLookup.java:109)
	at net.java.games.joal.impl.ALCImpl.alcOpenDevice(ALCImpl.java:341)
	at net.java.games.joal.util.ALut.alutInit(ALut.java:69)
	at demos.devmaster.lesson1.SingleStaticSource.initialize(SingleStaticSource.java:194)
	at demos.devmaster.lesson1.SingleStaticSource.access$000(SingleStaticSource.java:57)
	at demos.devmaster.lesson1.SingleStaticSource$1.actionPerformed(SingleStaticSource.java:79)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
	at java.awt.Component.processMouseEvent(Component.java:6263)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6028)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4630)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.RuntimeException: Unable to find and load OpenAL library
	at net.java.games.joal.impl.ALProcAddressLookup$DynamicLookup.dynamicLookupFunction(ALProcAddressLookup.java:66)
	at com.sun.gluegen.runtime.ProcAddressHelper.resetProcAddressTable(ProcAddressHelper.java:106)
	... 30 more


ok, the site demo still throws, as said above: (it has worked earlier this year though)
Exception in thread “AWT-EventQueue-2” java.lang.RuntimeException: Can not get proc address for method “alcCaptureCloseDevice”: Couldn’t set value of field “_addressof_alcCaptureCloseDevice” in class net.java.games.joal.impl.ALCProcAddressTable
at com.sun.gluegen.runtime.ProcAddressHelper.resetProcAddressTable(ProcAddressHelper.java:113)
at net.java.games.joal.impl.ALProcAddressLookup.resetALCProcAddressTable(ALProcAddressLookup.java:109)
at net.java.games.joal.impl.ALCImpl.alcOpenDevice(ALCImpl.java:341)
at net.java.games.joal.util.ALut.alutInit(ALut.java:69)
Caused by: java.lang.RuntimeException: Unable to find and load OpenAL library
at net.java.games.joal.impl.ALProcAddressLookup$DynamicLookup.dynamicLookupFunction(ALProcAddressLookup.java:66)

My own program was giving me an exception on initing AL, this is however working again.
Exception in thread “AWT-EventQueue-7” java.lang.NoClassDefFoundError: de/jarnbjo/vorbis/VorbisStream

So it seems being dependent on some other site to get the correct libraries is just a crap decision, if they change or
are down for whatever reason the applet wont work, AND it wont get caught with a try/catch!
With LWJGL seems like i can put the relevant libs in the server, and be 100% certain they will work, not relying on outside links.

Still all this is a farcry from the ease of Flash deployment, and I’m starting to understand why most game sites won’t accept Java applications…
If I cant pack my game into ONE file, then app management for a big game site becomes that much more of a hassle.
They have to have the right stuff in the html, and extra files for either the jnlp header.
The JNLP loading is dead ugly… I’m starting to seriously think about switching to Flash after this project sigh

Sound doesn’t appear to be the only problem with that JOGL Applet.
When I scroll the page using the mouse wheel (Firefox 3.0.1.4; Java 1.6.0_15, nvidia 8800gtx), the 3d portion of the Applet (GLCanvas?) draws outside the bounds of the Applet. (temporarily dirtying the the “The applet above is instantiated with the following code:” text immediately below the applet)

As for IE8… it doesn’t even launch. “Error : java.io.IOException: Cannot find certificates for JNLPAppletLauncher class” :persecutioncomplex:

yes, never use nightly builds in a production system

If your using an applet with LWJGL, you can package your whole project into two jars, one jar will contain your project+lwjgl and the other will contain the native dll files.
Plus it has a nice loading screen :slight_smile:

an example of a LWJGL applet project can be found here (OpenGL + OpenAL used, do also notice the fullscreen support :))

kapta’s game is looking damn good - clean loader, tells you exactly whats going on, minimum of ‘blank screen’
you wouldn’t happen to have written a tutorial on how to make this system?
Or is this all part of the Slick package?

the loader is LWJGL’s AppletLoader (handles all the dirty stuff with deploying natives, has a fully customisable loading screen, its own caching mechanism and provides pack200 + lzma support).

The applet and full screen stuff is part of Slick2D but should be fairly easy to do with plain LWJGL if you are familiar with OpenGL.

You can download the LWJGL Applet package to see a simple example on how to use LWJGL with applets, the slick wiki has a few tutorials on how to create similar applets with slick (but should be relatively easy to apply to normal LWJGL applets depending on how familiar you are with LWJGL and slick).

You can probably also get real time support on the lwjgl’s irc channel at #LWJGL on freenode.

(Bah: got this under Chrome:):


java.lang.NullPointerException
	at org.lwjgl.util.applet.AppletLoader.validateCertificateChain(Unknown Source)
	at org.lwjgl.util.applet.AppletLoader.extractNatives(Unknown Source)
	at org.lwjgl.util.applet.AppletLoader.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

after loading seemed to complete.

Cas :slight_smile:

It means you somehow got a corrupt download on one of the native jars.

The problem is fixed in svn and latest nightly builds of LWJGL’s AppletLoader, so should no longer happen in future versions of LWJGL as the AppletLoader has recently got a much more robust and reliable download system.

Just waiting for LWJGL 2.2, it should be out any day now.

edit: @princec just updated the version on that game, can you give it another try?

That’s better :slight_smile:

Cas :slight_smile:

I am trying to find some time to do it between other work and moving - not sure when “any day now” is :confused:
hopefully I can find some time on tomorrow or the day after that … I need to finish some other work tonight and and friday we’re moving.
and moving == semi-offline until the 26th earliest :frowning:

Final note, i guess jnlp is not really the problem- i finally understood that the main thing annoying me is the blank white screen while loading libraries, no way to get a splash screen in there?

The failing OggVorbis was inside code, not jnlp’s fault:
Is it in any way possible to use the NOT nightly builds, now using:

import de.jarnbjo.ogg.CachedUrlStream;
import de.jarnbjo.ogg.EndOfOggStreamException;
import de.jarnbjo.ogg.LogicalOggStream;
import de.jarnbjo.vorbis.IdentificationHeader;
import de.jarnbjo.vorbis.VorbisStream;

And one more question: why doesn’t a generic try/catch fail here?


try {
       System.out.println("init Sounds");
        // REM crashing here when de/jarnbjo not available...
        sm=new SoundManager();
} catch (Exception e) {
	e.printStackTrace();
}

Do I need specifically the Unsatisfied Link Error or something?

Should i be taking the actual source he uses and putting that into my code?
This is the closest i could find i think
http://svn.shredzone.org/tags/ifish/v1.4/src/de/jarnbjo/

I’d really like to be certain I have a working version as backup before I start
the overhaul to LWJGL…

Exception != Error - try catching Throwable insteasd (that should catch everything)

I dont quite get how. I can’t implement Throwable for SoundManager class:
“The type Throwable cannot be a superinterface of SoundManager; a superinterface must be an interface”
Could you explain in more detail how this should be done?

EDIT: Thanks Matzon!

try {
       System.out.println("init Sounds");
        // REM crashing here when de/jarnbjo not available...
        sm=new SoundManager();
} catch (Throwable t) {
	t.printStackTrace();
}