I'm on travel this week and have been showing various people the cool things you can do with Java and OpenGL. So far, everyone has been impressed, even with the admittedly junior stuff I've put together thus far (although it does include some vertex and frag programming! Yeah!)

Only on one computer have I had any problems. Oddly enough, it throws an EXCEPTION_ACCESS_VIOLATION in the polling of the Keyboard...

I figured any problems I encountered would be in the rendering, etc. (I have all the advanced stuff off by default to keep from crashing any low end pc on the first run...)

Anyhow, does anyhow have any suggestions on what I can try here? I'd like to understand why this is happening in case I come across it again in support of a real program down the road. I have access to the offending PC for about another week and can try tests. I don't have any good way to code until I get back home though.

Here's the PC's specs:

Pentium 3 466MHZWinXP SP1512MB Ramseveral GB of available HD space.Video card is on board and shares 16 MB of the system Ram... not sure who made it.Java 1.4.2_01-b06

Well, I've tried Alien Flux and it bombs out saying that I need to have an OpenGL able card. Would the kind of error I'm seeing be OpenGL related though? (considering it is Keyboard and all) Or perhaps your game tests all that before touching the keyboard...

I'll next run my app with the drivers you pointed to. After that, I'll look up the board info and see if I can determine the manufacturer of the card.

Results of run with debug dll... It looks like a 1 and 2 are printed out...

I was able to access my code remotely and ack... I feel a bit stupid, and yet still puzzled too. The local error was saying I had an NPE. Based on the Exception error message discussing Keyboard, and my own remembrance of the code lines, I thought that the NPE corresponded to my call to Keyboard.create(). Looking at the actual code though I'm embarrassed because the error is a few lines earlier actually, where I am calling Window.create()

Since I am getting an NPE there, I'm guessing it was due to my use of mode.bpp, etc. without checking to make sure mode is non-null. As Alien Flux indicated, this is probably due to no GL drivers for my card, thus no valid mode was found in my code before there.

Still, why is that whole message regarding the Keyboard and Exception access violation printing out? Is that where the native side was when the java side failed? :-/

Sorry if this turned out to be a goose chase. The error messages seemed to point the way I was going. (I'd really like to understand why it says the Keyboard thing though.) I will still look for an updated driver to whatever card this thing is running and let you know if that clears up the problem.

Are you perchance catching and printing the NPE, but continuing regardless? The last time I checked I believe LWJGL crashed out with that kind of error if you tried to open input devices without opening a GL window. Maybe your code fails on opening the window but then tries the controller creation anyway?

Hang on, I think Brian has just fixed this bug already in CVS. If keyboard creation failed in the current released 0.8 it was somehow possible to still call methods on it. I haven't looked at the fix yet.

It's sort of telling that AF complains you don't have an OpenGL card... it'll tend to do this when you genuinely don't have OpenGL drivers installed, and if you don't have drivers, it can't create the LWJGL window, and if you don't create the window, it can't create the DirectInput handler for the keyboard...

Are you perchance catching and printing the NPE, but continuing regardless? The last time I checked I believe LWJGL crashed out with that kind of error if you tried to open input devices without opening a GL window. Maybe your code fails on opening the window but then tries the controller creation anyway?

Doh, that's the last piece of the puzzle. Yeah, basically, mode was null, thus NPE... catch prints it out but continues... Comes back and goes into the main loop where it goes out to my Keyboard delegate and calls a poll.

Thanks all for helping me figure that out. Sorry for the chase. <muse>I think if we put together a best practices demo for gathering and selecting the proper display mode(s) (and handling exceptions... hehe,) that might help future lwjgl developers avoid mistakes like this.</muse>

As for me... I'm just feeling pretty silly for not catching it myself. Bad assumptions about ppl having GL on my part.

PS: After discovering the built in card was some form of nVidia Alladin TNT2, I was able to force an upgrade of the driver and now the app works fine (albeit a bit slow and without some parts of the app) I'm impressed it can run on something so old!

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org