LWJGL Forum

Programming => OpenAL => Topic started by: amoeba on December 05, 2007, 21:47:11

Title: wavedata.create nullpointerexception
Post by: amoeba on December 05, 2007, 21:47:11
I am getting an odd problem when trying to run the OpenAL lesson 5 example with netbeans.

When I try to run I get;

D:\lesson5>java -Djava.library.path=lib/win32 -jar "D:\lesson5\dist\lesson5.jar"
java.lang.NullPointerException
        at org.lwjgl.util.WaveData.create(WaveData.java:95)
        at org.lwjgl.util.WaveData.create(WaveData.java:112)
        at Lesson5.loadALData(Lesson5.java:125)
        at Lesson5.execute(Lesson5.java:222)
        at Lesson5.main(Lesson5.java:261)
Exception in thread "main" java.lang.NullPointerException
        at Lesson5.loadALData(Lesson5.java:126)
        at Lesson5.execute(Lesson5.java:222)
        at Lesson5.main(Lesson5.java:261)


Is this problem caused by a missing the openal32.dll? I have it in /lib/win32 with the rest of the DLLs.
Title: Re: wavedata.create nullpointerexception
Post by: amoeba on December 05, 2007, 21:50:45
When I run in debug I get this further information:

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [../../../src/share/back/util.c:820]
Title: Re: wavedata.create nullpointerexception
Post by: Matzon on December 05, 2007, 22:23:29
the debug stuff is unrelated, but the NPE is because the res folder isn't on the classpath so it fails to locate the file in the create method
Title: Re: wavedata.create nullpointerexception
Post by: amoeba on December 05, 2007, 23:16:02
The res folder is the Eclipse folder where the classes get compiled or where the jar gets put?
Title: Re: wavedata.create nullpointerexception
Post by: Matzon on December 06, 2007, 06:08:00
the res folder is the res folder when you extracted lwjgl :)
Title: Re: wavedata.create nullpointerexception
Post by: amoeba on December 06, 2007, 09:03:59
Why do I need the res folder in classpath, it just contains some sound and image files?