Summary: | JOAL lacks Platform.initSingleton() - Using TempJarCache reveals unresolved initialization dependency leading to NPE in NativeLibrary | ||
---|---|---|---|
Product: | [JogAmp] Joal | Reporter: | Julien Gouesse <gouessej> |
Component: | core | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | --- | ||
Version: | 1.0 | ||
Hardware: | All | ||
OS: | all | ||
Type: | --- | SCM Refs: |
c18c52b8c20aa03a08940bef81b620d48c4117e2
|
Workaround: | --- |
Description
Julien Gouesse
2012-01-04 16:06:26 CET
IMHO the bug description is wrong, since this setup, 32-on-64 is working on all our test nodes (-> unit tests) incl. JOAL. Besides, I have tested 32bit browsers on 64bit OS incl JOAL. As far as I can read your exception, it's an NPE: Caused by: java.lang.NullPointerException at com.jogamp.common.os.NativeLibrary.isValidNativeLibraryName(NativeLibrary.java:259) at com.jogamp.common.util.cache.TempJarCache.findLibrary(TempJarCache.java:288) at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:303) at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:55) at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:85) at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:215) Please rename the bug description (if bug still valid) and provide a 'trace' w/ all debug infos on. Thank you Julien. Additional notes .. NativeLibrary.java line 259 of latest GlueGen source code commit aa4cc872d630d7de170bdc4202d072220c053325: +++ 259: for(int i=0; i<prefixes.length; i++) { +++ implies that 'prefixes' is null, which is set in the static init block in a switch-case with default case. How could this date be null at all ? Probably b/c of an unresolved initialization sequence / dependency, ie from: com.jogamp.openal.ALFactory.initialize(ALFactory.java:58) where Platform is not initialized before actually attempting to call the NativeLibrary loading mechanism. Pls try to call 'Platform.initSingleton()' upfront you overall demo and tell me if this solves the issue. In this case, I will fix the lack of Platform initialization where it belongs, ie: ALFactory. The same Platform.initSingleton() is performed in JOGL and JOCL, so it works there. +++ 'sun.arch.data.model' would not be sufficient for os_and_arch derivation. We use 'os.name' and 'os.arch' in Platform to derive os_and_arch in the same manner as we use it at build time in gluegen's gluegen-cpptasks-base.xml. This way we ensure same set of supported platforms and behavior. Further more, we validate the findings w/ the runtime MachineDescription, hence if our assumption is wrong GlueGen will immediatly throw an Exception and stop working. Ok, fixed bug title and module. I am pretty sure my comment 2 describes the culprit. JOAL commit c18c52b8c20aa03a08940bef81b620d48c4117e2 should fix this issue. Please verify. If this commit does not fix the issue, pls try to call Platform.initSingleton() upfront in you application. In either case, pls write about the results / confirmation. Hi I will update TUER in order to use GlueGen build 473, JOAL build 267 and JOGL build 618. I will reopen this bug if necessary, otherwise I will confirm this bug fix works. My demo now uses Updates JOGL 2.0 (build 620), JOAL 1.1.3 (build 268) and GlueGen (build 474) ,you can launch it here: http://tuer.sourceforge.net/very_experimental/tuer.jnlp I'm going to ask someone to test it again. I confirm this bug is fixed, EgonOlsen confirmed it works fine now :) awesome. I reopen this bug because the loading of JOAL native libraries still fails when using a 32 bits JVM on a 64 bits OS, I get this on the laptop Packard Bell EasyNote MH36: [java] Exception in thread "Thread-9" java.lang.ExceptionInInitializerError [java] at com.jogamp.openal.ALFactory.initialize(ALFactory.java:96) [java] at com.jogamp.openal.ALFactory.getALC(ALFactory.java:140) [java] at com.jogamp.openal.util.ALut.alutInit(ALut.java:66) [java] at paulscode.sound.libraries.LibraryJOAL.init(LibraryJOAL.java:154) [java] at paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576) [java] at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572) [java] at paulscode.sound.CommandThread.run(CommandThread.java:121) [java] Caused by: java.lang.RuntimeException: Couln't load native AL library [java] at jogamp.openal.ALImpl.<clinit>(ALImpl.java:1618) [java] ... 7 more Sorry, I was wrong, using a 64 bits JVM doesn't solve the problem. |