Implementing JOGL

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Implementing JOGL

glennp
I am in the process of developing a desktop mapping application using GeoTools.  It will only run on Windows.  I need to use hardware acceleration in order to make this application work properly.  In researching Open GL it seems that the Java world relies on JOGL to accomplish this.

I am developing on Win 7 32-bit so I downloaded the i586 version.  Now I am trying to run the test_dbg bat file.  I do get a window briefly displayed.  But the log file contains all sorts of errors.  Obviously I do not have the run time environment set up properly.  I tried going with the JOGL Userguide, but it does say it is out of date.  I have tried searching for more up to date instructions but can't find anything.

Could someone please outline the proper installation for the latest version of JOGL?

After it first failed I did make some modifications to the bat file based on what I saw in the Userguide.  Here is what I am trying to run:

set path=D:\java\jogamp-windows-i586\lib;%PATH%
set BLD_DIR=D:\java\jogamp-windows-i586\jar

set CP_ALL=.;%BLD_DIR%\gluegen-rt.jar;%BLD_DIR%\jogl.all.jar;%BLD_DIR%
echo CP_ALL %CP_ALL%

set D_ARGS="-Djogamp.debug=all" "-Dnativewindow.debug=all" "-Djogl.debug=all" "-Dnewt.debug=all"
set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"

java -classpath %CP_ALL% %X_ARGS% %D_ARGS% com.jogamp.newt.opengl.GLWindow >> test_dbg.log 2>&1

I do get a lot of output.  Evidently it is verifying that it can access all the proper jar and DLL files.

The first error I find in the log is:

JNILibLoaderBase: loaded gluegen-rt
java.lang.Exception: JVMUtil.initSingleton() .. initialized main
	at jogamp.common.jvm.JVMUtil.<clinit>(JVMUtil.java:62)
	at com.jogamp.common.os.Platform.<clinit>(Platform.java:215)
	at com.jogamp.common.util.VersionUtil.getPlatformInfo(VersionUtil.java:54)
	at com.jogamp.common.util.VersionUtil.getPlatformInfo(VersionUtil.java:82)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:909)

Then I get:

GLProfile.initSingleton(firstUIActionOnProcess: false) - thread main
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Thread.java:1249)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:117)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:913)

And  little later I get:

java.lang.Throwable: main - Info: NativeWindowFactory.<init>
	at javax.media.nativewindow.NativeWindowFactory.<clinit>(NativeWindowFactory.java:138)
	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1214)
	at javax.media.opengl.GLProfile.access$000(GLProfile.java:75)
	at javax.media.opengl.GLProfile$1.run(GLProfile.java:133)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:122)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:913)

And on down the log I find:


GLDrawableFactory.static - Native OS Factory for: Windows: jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory
main - DynamicLibraryBundle.init start with: jogamp.opengl.windows.wgl.WindowsWGLDynamicLibraryBundleInfo
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Thread.java:1249)
	at com.jogamp.common.os.DynamicLibraryBundle.<init>(DynamicLibraryBundle.java:82)
	at jogamp.opengl.GLDynamicLookupHelper.<init>(GLDynamicLookupHelper.java:36)
	at jogamp.opengl.DesktopGLDynamicLookupHelper.<init>(DesktopGLDynamicLookupHelper.java:37)
	at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory.<init>(WindowsWGLDrawableFactory.java:93)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:166)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:188)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:208)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:230)
	at javax.media.opengl.GLDrawableFactory.initSingletonImpl(GLDrawableFactory.java:150)
	at javax.media.opengl.GLDrawableFactory.initSingleton(GLDrawableFactory.java:115)
	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1244)
	at javax.media.opengl.GLProfile.access$000(GLProfile.java:75)
	at javax.media.opengl.GLProfile$1.run(GLProfile.java:133)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:122)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:913)

And then I start getting X11 errors.  This I don't understand since I am running on Windows.  I thought X11 is for Linux.  Here is the start of the errors:

JNILibLoaderBase: loadLibraryInternal(nativewindow_x11) -> TempJarCache not mapped
JNILibLoaderBase: loadLibraryInternal(nativewindow_x11) -> System.loadLibrary(nativewindow_x11)
java.lang.UnsatisfiedLinkError: no nativewindow_x11 in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
	at java.lang.Runtime.loadLibrary0(Runtime.java:823)
	at java.lang.System.loadLibrary(System.java:1028)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:318)
	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)
	at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:365)
	at com.jogamp.common.os.DynamicLibraryBundle.loadLibraries(DynamicLibraryBundle.java:274)
	at com.jogamp.common.os.DynamicLibraryBundle.<init>(DynamicLibraryBundle.java:87)
	at jogamp.opengl.GLDynamicLookupHelper.<init>(GLDynamicLookupHelper.java:36)
	at jogamp.opengl.DesktopGLDynamicLookupHelper.<init>(DesktopGLDynamicLookupHelper.java:37)
	at jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory.<init>(WindowsWGLDrawableFactory.java:93)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:166)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:188)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:208)
	at com.jogamp.common.util.ReflectionUtil.createInstance(ReflectionUtil.java:230)
	at javax.media.opengl.GLDrawableFactory.initSingletonImpl(GLDrawableFactory.java:150)
	at javax.media.opengl.GLDrawableFactory.initSingleton(GLDrawableFactory.java:115)
	at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1244)
	at javax.media.opengl.GLProfile.access$000(GLProfile.java:75)
	at javax.media.opengl.GLProfile$1.run(GLProfile.java:133)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:122)
	at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:151)
	at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1688)
	at javax.media.opengl.GLProfile.get(GLProfile.java:652)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:478)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
	at com.jogamp.newt.opengl.GLWindow.main(GLWindow.java:913)
Info: Could not load JNI/Glue library: nativewindow_x11

And then I start getting a huge list of failed lookups.  Here is just a small list:

Lookup-Native: <glMapBuffer> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferARB> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferGL2> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferOES> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferKHR> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferOML> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBuffer3DFX> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferAMD> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferANGLE> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferARM> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferAPPLE> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferATI> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferEXT> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferHI> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferHP> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferIBM> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferIMG> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferMESA> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferMESAX> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferNV> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]
Lookup-Native: <glMapBufferQCOM> ** FAILED ** in libs [NativeLibrary[OpenGL32.dll, 0x66740000, global false]]

I'll stop here.  I don't know what to do to fix this.  Could someone please give me some instructions on what is wrong and how I go about fixing it?

I do greatly appreciate any feedback to help get me past this!!
Reply | Threaded
Open this post in threaded view
|

Re: Implementing JOGL

Wade Walker
Administrator
I wouldn't advise looking at the test.bat file -- it seems to be just for the use of the developers, and can be left in unpredictable states on check-in  Those error messages you're seeing are just diagnostic output, not necessarily real errors.

To download and install JOGL, see this: http://jogamp.org/wiki/index.php/Downloading_and_installing_JOGL
To set up a JOGL project in your favorite IDE or on the command line, see this: http://jogamp.org/wiki/index.php/Downloading_and_installing_JOGL
For some tutorials, see this: http://jogamp.org/wiki/index.php/Jogl_Tutorial

Let me know if there are errors on any of these wiki pages; if so, I will fix them.
Reply | Threaded
Open this post in threaded view
|

Re: Implementing JOGL

Sven Gothel
Administrator
In reply to this post by glennp
On 03/25/2012 06:59 PM, glennp [via jogamp] wrote:
>
> I am developing on Win 7 32-bit so I downloaded the i586 version.  Now I am
> trying to run the test_dbg bat file.  I do get a window briefly displayed.
> But the log file contains all sorts of errors.  

The log file snippets you showed were not error
but a very verbose runtime trace, helping us to understand why
JOGL may not work, i.e. certains assumptions were not matched.

Try test.bat, which doesn't include the verbose traces.
If all goes well, you should see some verbose information of
available OpenGL profiles and some platform information.

> Obviously I do not have the
> run time environment set up properly.  I tried going with the JOGL
> Userguide, but it does say it is out of date.  I have tried searching for
> more up to date instructions but can't find anything.

The userguide itself states it's out of date (currently under review
in our git repository) .. as Wade stated, pls check the Wiki.

>
> Could someone please outline the proper installation for the latest version
> of JOGL?

You can 'simply' check the JOGL test applets to see how the online deployment
works .. again - wiki pages are very thoroughly (Eclipse, Applets, Webstart,
Netbeans, ...) - thanks to Wade and others.

Of course .. even the Wiki does not catch all the newt stuff we work on
but sooner or later .. somebody will fix them :)

Hope this helps a bit.

Cheers, Sven


signature.asc (910 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Implementing JOGL

glennp
In reply to this post by glennp
Thanks for your input.   I will see what I can do today.  Since this is such a big task trying to integrate JOGL into GeoTools I just want to make sure I have JOGL installed and running properly before starting to change the GeoTools code.  Because of the limitations of GeoTools my only practical approach is to develop a desktop swing application.  Even the Swing code is considered "unsupported".  

So I'm on my own in this endeavor.  The application will not be successful without hardware acceleration.  And I need to have a working demo by mid-July.  Seems like a long time out, but it will be here before I know it.  And a lot of this is totally new to me.  I am a J2EE developer for the most part.

Luckily this has no requirement to be portable.  The ONLY platform it will run on is Windows.  So I can just concentrate on that.

Thanks again.
Reply | Threaded
Open this post in threaded view
|

Re: Implementing JOGL

gouessej
Administrator
I don't know how you contribute to GeoTools but if your contribution is public, please don't do anything to prevent a wider support of other operating systems which is very easy with JOGL.
Julien Gouesse | Personal blog | Website