Strange multitexturing error

I’m getting the following printed to stdout when I attempt to multitexture with more than three textures. I’m not sure if this is due to an out of memory error or there issomething wrong with multitexturing. There is no error message, just the below printed out to stdout. Also, all textures used after the first two are rendered as solid colors. At the moment, I’m using about 7 textures of size 512x512. Could this be causing memory problems?

new structures: data is 05804FE8, cinfo is 035824E0
In readImageHeader, data is 05804FE8 cinfo is 035824E0
clearFirst is 0
Filling input buffer, remaining skip is 0, Buffer length is 4096
Buffer filled. ret = 4096
In readImageHeader, data is 05804FE8 cinfo is 035824E0
clearFirst is 1
Filling input buffer, remaining skip is 0, Buffer length is 4096
Buffer filled. ret = 4096
---- in reader.read ----
numBands is 3
bands array: 0 1 2
jq table 0 at 03582798
Filling input buffer, remaining skip is 0, Buffer length is 4096
Buffer filled. ret = 4096

etc…

I’ve upgraded to the June 23 2006 nightly build of JSR 231. I’m now getting a more clear error message. It seems that when I call

        glu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, ...);

twice on the same texture name, the below exception would be thrown. What I am trying to do is update texture that has changed it’s image data. Is what I’m doing illegal? If it is, shouldn’t a JOGL exception be thrown instead of a generic OutOfBounds?

exception in QueueFlusher:
java.lang.IndexOutOfBoundsException: Required 1024 remaining bytes in buffer, only had 0
at com.sun.gluegen.runtime.BufferFactory.rangeCheckBytes(BufferFactory.java:274)
at com.sun.opengl.impl.GLImpl.glTexImage2D(GLImpl.java:19579)
at javax.media.opengl.DebugGL.glTexImage2D(DebugGL.java:8445)
at com.sun.opengl.impl.mipmap.BuildMipmap.gluBuild2DMipmapLevelsCore(BuildMipmap.java:311)
at com.sun.opengl.impl.mipmap.Mipmap.gluBuild2DMipmaps(Mipmap.java:721)
at javax.media.opengl.glu.GLU.gluBuild2DMipmapsJava(GLU.java:1525)
at javax.media.opengl.glu.GLU.gluBuild2DMipmaps(GLU.java:1581)
at com.pantometrics.node.appearance.TextureProducer.setRenderTexture(TextureProducer.java:145)
at com.pantometrics.node.appearance.Appearance.setRenderAppearance(Appearance.java:220)
at com.pantometrics.scene.waypoint.Waypoint.render(Waypoint.java:100)
at com.pantometrics.node.SceneNodeGroup.render(SceneNodeGroup.java:255)
at com.pantometrics.node.SceneNodeGroup.render(SceneNodeGroup.java:255)
at com.pantometrics.display.PantoSceneViewPanel.display(PantoSceneViewPanel.java:335)
at com.kitfox.panto.editor.form.window.designerView.world3d.World3dEditPanel.display(World3dEditPanel.java:152)
at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:281)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:298)
at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)

Figured it out. I was neglecting to rewind my buffer of bytes before redefinng my texture data.