Lesson 3: ArrayIndexOutOfBoundsException

I am a beginner here so I am making my way through the tutorials. I got all the way to the ChaseCamera tutorial using the released version of jme (0.9)… then I realized that the code I needed (ChaseCamera) was only in the CVS source. I downloaded it, built it and ran through some of the tests.



I had an error in the TestLensFlare test:



INFO: Child (my box) attached to this node (rootNode)

Dec 9, 2005 10:33:14 AM com.jme.scene.Node attachChild

INFO: Child (light) attached to this node (rootNode)

Dec 9, 2005 10:33:14 AM com.jme.scene.Node attachChild

INFO: Child (flare) attached to this node (rootNode)

java.lang.ArrayIndexOutOfBoundsException: 1

        at com.jme.scene.VBOInfo.getVBOTextureID(Unknown Source)

        at com.jme.renderer.lwjgl.LWJGLRenderer.prepVBO(Unknown Source)

        at com.jme.renderer.lwjgl.LWJGLRenderer.predrawGeometry(Unknown Source)

        at com.jme.renderer.lwjgl.LWJGLRenderer.draw(Unknown Source)

        at com.jme.scene.TriMesh.draw(Unknown Source)

        at com.jme.renderer.RenderQueue.renderOrthoBucket(Unknown Source)

        at com.jme.renderer.RenderQueue.renderBuckets(Unknown Source)

        at com.jme.renderer.Renderer.renderQueue(Unknown Source)

        at com.jme.renderer.lwjgl.LWJGLRenderer.displayBackBuffer(Unknown Source)

        at com.jme.app.BaseGame.start(Unknown Source)

        at jmetest.effects.TestLensFlare.main(Unknown Source)

Dec 9, 2005 10:33:14 AM com.jme.app.BaseSimpleGame cleanup

INFO: Cleaning up resources.



but I decided to press on with the tutorial… after a few tweaks I was able to run Lesson 1 and 2 with no problem; however Lesson 3 gave a similar error the one TestLensFlare gave me:



Dec 9, 2005 11:16:05 AM com.jme.scene.Node attachChild

INFO: Child (Terrain) attached to this node (Scene graph node)

java.lang.ArrayIndexOutOfBoundsException: 1

at com.jme.scene.VBOInfo.getVBOTextureID(Unknown Source)

at com.jme.renderer.lwjgl.LWJGLRenderer.prepVBO(Unknown Source)

at com.jme.renderer.lwjgl.LWJGLRenderer.predrawGeometry(Unknown Source)

at com.jme.renderer.lwjgl.LWJGLRenderer.draw(Unknown Source)

at com.jme.scene.TriMesh.draw(Unknown Source)

at com.jme.scene.lod.ClodMesh.draw(Unknown Source)

at com.jme.scene.Spatial.onDraw(Unknown Source)

at com.jme.scene.Node.draw(Unknown Source)

at com.jme.scene.Spatial.onDraw(Unknown Source)

at com.jme.renderer.lwjgl.LWJGLRenderer.draw(Unknown Source)

at lessons.Lesson3.render(Lesson3.java:50)

at com.jme.app.BaseGame.start(Unknown Source)

at lessons.Lesson3.main(Lesson3.java:37)

Dec 9, 2005 11:16:05 AM com.jme.app.BaseGame start



I did some forum searches and code poking but am unable to figure out what the problem is. I am running Java version 1.4.2_03 and I did see some mention of issues with _06, so I will try and upgrade this computer when time permits. I will also try to reproduce the issue at home where I am running 1.5.x. My OS is Windows XP on an IBM ThinkPad with plenty of processor and ram… and all of my drivers are up to date.



I will try to dive in and do a little debugging, but as I said, I am new to JMe and to game/opengl programming in general so I am not sure how far I will get… I figured I'd drop in a post and see if anyone else has the same problem.



Any help or direction would be great. Thanks.

Unfortunately you happened to grab from cvs in the middle of some dev work on tex coords.  This should be cleared up by the end of the day.  Sorry for the inconvenience.

Not a problem. Thanks for the info.

Try updating again and see if it's fixed for you. (I'm curious if you are going to have JVM issues)

I tried it both on Java 1.5.x at home and 1.4.x at work and both work with the latest source from CVS. Thanks for the help.

I am now having the same issue… that cjstehno was having, what exactly did he do to fix it?

I pulled the latest (at the time) source from CVS and did a build according to the GettingStarted (http://www.jmonkeyengine.com/wiki/doku.php?id=getting_started) documentation. I have not pulled down CVS since that next day… so I am not sure whether anything was broken after that point. Life on the bleeding edge, I guess. :slight_smile:



I would recommend doing the same. Good luck!

ok it worked, thank you