Hello Guest

wavedata.create nullpointerexception

  • 5 Replies
  • 9267 Views
wavedata.create nullpointerexception
« 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;
Code: [Select]
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.

Re: wavedata.create nullpointerexception
« Reply #1 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]

*

Offline Matzon

  • *****
  • 2242
Re: wavedata.create nullpointerexception
« Reply #2 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

Re: wavedata.create nullpointerexception
« Reply #3 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?

*

Offline Matzon

  • *****
  • 2242
Re: wavedata.create nullpointerexception
« Reply #4 on: December 06, 2007, 06:08:00 »
the res folder is the res folder when you extracted lwjgl :)

Re: wavedata.create nullpointerexception
« Reply #5 on: December 06, 2007, 09:03:59 »
Why do I need the res folder in classpath, it just contains some sound and image files?
« Last Edit: December 06, 2007, 20:32:55 by amoeba »