English 中文(简体)
Help debugging GL_VERSION error in a Java3d application
原标题:

I m working on a 3d globe application written in java using java3d for the rendering. I ve got a windows installer that basically copies files from a development snapshot to the program files directory. It runs fine from the devel snapshot, but when running after an install it does this:

Java 3D ERROR : OpenGL 1.2 or better is required (GL_VERSION=1.1)  
javax.media.j3d.IllegalRenderingStateException: GL_VERSION  
    at javax.media.j3d.NativePipeline.createNewContext(Native Method)  
    at javax.media.j3d.NativePipeline.createNewContext(NativePipeline.java:2736)  
    at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4895)  
    at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2421)  
    at javax.media.j3d.Renderer.doWork(Renderer.java:895)  
    at javax.media.j3d.J3dThread.run(J3dThread.java:256)  

I ve compared the all the libraries and jars in the development directories and the files are all exactly the same and none are missing. It s the weirdest thing. I ve updated my graphics drivers (though they re clearly sufficient since things run fine from a devel snapshot). I ve written a simple java3d app that is able to make a Canvas3D and add a ColorCube to it. It runs fine. P.s. our development snapshot includes all the dlls, jars, and the jre things run from. We log all the library and jvm versions and they re exactly the same in logs generated from the devel snapshot and the installed application. We run using an explicit path to java.exe (..jreinjava.exe), so the PATH variable isn t in play.

I m looking for ideas to debug this. I d like to write a simple java app that prints all the GL attributes, especially GL_VERSION, to try to demonstrate some quantifiable difference between the two set ups. The java3d docs don t cover that, and all internet searches for GL_VERSION problems just tell you to update your drivers.

Oh, I ve got Nvidia Quadro FX 3800 cards. Two of em actually.

In summary...
Q1: How do you print GL_VERSION for your java3d application?
Q2: What the heck is going on?

最佳回答

After typing about my two graphics cards, I started thinking about how I recently switched from using four monitors to just three, so I could use the fourth for my new laptop. Turns our our application had saved some properties in my home folder that had our application starting up on the fourth, now non-existent monitor. It appears that java3d didn t find opengl sufficiently supported in non-existent screen space, and threw the above exception. Starting the application with valid screen coordinates solved the issue.

问题回答

to check GL_VERSION use queryProperties() method on your Canvas3D.

String glVersion = (String)getCanvas3D().queryProperties().get("native.version");

But this error does not display the accurate version of OpenGL, using the code above you will likely see that you re GL_VERSION is not 1.1 like in the stacktrace (I had same error with OpenGL 1.5 installed).





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签