Trouble with texturing

java.lang.IllegalArgumentException: Illegally formatted version identifier: “null”
at com.sun.opengl.impl.FunctionAvailabilityCache$Version.(FunctionAvailabilityCache.java:317)
at com.sun.opengl.impl.FunctionAvailabilityCache.initAvailableExtensions(FunctionAvailabilityCache.java:132)
at com.sun.opengl.impl.FunctionAvailabilityCache.isExtensionAvailable(FunctionAvailabilityCache.java:103)
at com.sun.opengl.impl.GLContextImpl.isExtensionAvailable(GLContextImpl.java:244)
at com.sun.opengl.impl.GLImpl.isExtensionAvailable(GLImpl.java:27673)
at com.sun.opengl.impl.GLImpl.checkBufferObject(GLImpl.java:27707)
at com.sun.opengl.impl.GLImpl.checkUnpackPBODisabled(GLImpl.java:27728)
at com.sun.opengl.impl.GLImpl.glTexImage2D(GLImpl.java:19415)
at myApp.JoglEventListener.init(JoglEventListener.java:85)

Is thrown after executing the following code:


       ByteBuffer texture;
       IntBuffer textures;
       int tWidth;
       int tHeight;

       [image loading code here]

        textures=IntBuffer.allocate(1);
        myGL.glGenTextures(1, textures);
        int i=textures.array()[0];
        myGL.glBindTexture(GL.GL_TEXTURE_2D, i);
        texture.rewind();

        myGL.glTexImage2D(GL.GL_TEXTURE_2D, 0, 3, tWidth, tHeight,
                0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, texture);

Been on this for a while now… and I m sure it’s some stupid newbie thing I m doing ~ any ideas from you pro?
Thanks.

After going crazy for a day, and stumbling into every possible error… I finally had the great idea to run my applet directly. (I am using The JOGL Applet Launcher www.vlsolutions.com/free/jogltest/ made by Lilian, thanks for the great tool btw) So I found out my code was running perfectly fine, and the latest bunch of errors I was getting were coming from the awt stuff. Here’s a copy of the trace:

Exception in thread “AWT-EventQueue-1” java.lang.UnsatisfiedLinkError: JAWT_GetAWT0
at com.sun.opengl.impl.JAWTFactory.JAWT_GetAWT0(Native Method)
at com.sun.opengl.impl.JAWTFactory.JAWT_GetAWT(JAWTFactory.java:38)
at com.sun.opengl.impl.JAWT$1.run(JAWT.java:99)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.opengl.impl.JAWT.getJAWT(JAWT.java:95)
at com.sun.opengl.impl.windows.WindowsOnscreenGLDrawable.lockSurface(WindowsOnscreenGLDrawable.java:128)
at com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:58)
at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:74)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:117)
at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:236)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:127)
at javax.media.opengl.GLCanvas.paint(GLCanvas.java:139)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
at sun.awt.RepaintArea.paint(RepaintArea.java:224)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
at java.awt.Component.dispatchEventImpl(Component.java:4031)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

This happens with the latest jogl build and the applet launcher, so I guess it now needs some tuning to work again. I m going to look into it now to see if I can find a solution to this.

Okay… I think I tracked the problem down. Of course all this doesn’t have anything at all to do with texturing… ~


          if (osType != MAC_OS) { // borrowed from NativeLibLoader
            try {
              System.loadLibrary("jawt");
              System.out.println("jawt loaded");              
            } catch (UnsatisfiedLinkError ex) {
              // Accessibility technologies load JAWT themselves; safe to continue
              // as long as JAWT is loaded by any loader
              if (ex.getMessage().indexOf("already loaded") == -1) {
                displayError("Unabled to load JAWT");
                throw ex;
              }
            }
          }
          // static linking
          try {
            System.load(nativeLib.getPath());
            System.out.println("Jogl loaded from jar");
          } catch (UnsatisfiedLinkError ex) {
            // should be safe to continue as long as the native is loaded by any loader
            if (ex.getMessage().indexOf("already loaded") == -1) {
              displayError("Unable to load " + nativeLib.getName());
              throw ex;
            }
          }

          // disable JOGL loading form elsewhere
          com.sun.opengl.impl.NativeLibLoader.disableLoading();

This code loads the jawt and jogl from the jar it just uploaded to the target machine, then disables any further automatic library loading (last line). If I comment this last line, then netbean’s applet viewer will run the applet fine, by loading my dev. copy of jogl pointed to by the classpath. If I sign the jar and stuff and try to load it as it is on a machine without jogl in the class path, the jvm gets pissed. If I leave the disableLoading() directive there to do its job, then the applet will load, but then this error will be thrown:


Exception in thread "AWT-EventQueue-1" java.lang.UnsatisfiedLinkError: JAWT_GetAWT0
        at com.sun.opengl.impl.JAWTFactory.JAWT_GetAWT0(Native Method)
        at com.sun.opengl.impl.JAWTFactory.JAWT_GetAWT(JAWTFactory.java:38)
        at com.sun.opengl.impl.JAWT$1.run(JAWT.java:99)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.opengl.impl.JAWT.getJAWT(JAWT.java:95)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLDrawable.lockSurface(WindowsOnscreenGLDrawable.java:128)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:58)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:74)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:117)
        at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:236)
        at javax.media.opengl.GLCanvas.display(GLCanvas.java:127)
        at javax.media.opengl.GLCanvas.paint(GLCanvas.java:139)
        at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
        at sun.awt.RepaintArea.paint(RepaintArea.java:224)
        at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
        at java.awt.Component.dispatchEventImpl(Component.java:4031)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

This didnt happen with older builds of jogl, I think the jvm was happy enough with the manual loading of jawt and jogl. Not anymore now, anyone know if I need to manually load anything else to make this work?

Thanks.

Found it, this new release loads jogl_awt.dll, for the installer to work properly it has to copy that file as well as jogl.dll.
Problem solved ~ hope this can be useful.

FYI, the applet launcher is now in the JOGL workspace under com/sun/opengl/utils, and has already been updated to copy the jogl_awt native library into the appropriate place.