How to find the error cause?

Hello!

I again got the following exception:



[java]

java.lang.IllegalArgumentException: Number of remaining buffer elements is 0, must be at least 1. Because at most 1 elements can be returned, a buffer with at least 1 elements is required, regardless of actual returned element count

at org.lwjgl.BufferChecks.throwBufferSizeException(BufferChecks.java:162)

at org.lwjgl.BufferChecks.checkBufferSize(BufferChecks.java:189)

at org.lwjgl.BufferChecks.checkBuffer(BufferChecks.java:258)

at org.lwjgl.opengl.GL15.glBufferData(GL15.java:155)

at com.jme3.renderer.lwjgl.LwjglRenderer.updateBufferData(LwjglRenderer.java:2085)

at com.jme3.renderer.lwjgl.LwjglRenderer.setVertexAttrib(LwjglRenderer.java:2213)

at com.jme3.renderer.lwjgl.LwjglRenderer.setVertexAttrib(LwjglRenderer.java:2248)

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMeshDefault(LwjglRenderer.java:2453)

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMesh(LwjglRenderer.java:2500)

at com.jme3.material.Material.render(Material.java:1103)

at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:658)

at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:301)

at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:353)

at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:894)

at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:850)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1126)

at com.jme3.renderer.RenderManager.render(RenderManager.java:1168)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:254)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:182)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)

at java.lang.Thread.run(Thread.java:722)

[/java]

and it’s not pointing on any line in my code.

Last time I got that exception it was caused by a BitmapText so I removed all BitmapTexts - still get the error.

I can’t expect that anyone could tell me what the problem is because I would have to post all my code.

But how would you try to figure out what the problem is?

I’m trying to figure the problem out by commenting random lines of code for hours… very frustrating.



I know I can not ask “what is the problem there?” or “how do I solve this?” but maybe:



How would you try to figure the problem out?

first I would SHIFT + F11 to clean and rebuild, and see if that fixes the issue. Then I would use the debugger and step through the code until I found where the error was caused



at com.jme3.renderer.lwjgl.LwjglRenderer.updateBufferData(LwjglRenderer.java:2085)

at com.jme3.renderer.lwjgl.LwjglRenderer.setVertexAttrib(LwjglRenderer.java:2213)

at com.jme3.renderer.lwjgl.LwjglRenderer.setVertexAttrib(LwjglRenderer.java:2248)

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMeshDefault(LwjglRenderer.java:2453)

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMesh(LwjglRenderer.java:2500)

at com.jme3.material.Material.render(Material.java:1103)





This happens when rendering. Render mesh method is called.



Next it says “setVertexAttrib” is called. A vertex attribute is position, normal, tangent, texcoords etc. In other words it’s trying to write the attributes to the vertex buffer, but it fails.



I can’t say why. Never had this problem myself. It happens when buffers are manipulated from many places at once (like non synchronized). Probably other reasons as well.

Just one element in the buffer, I’m guessing this is a weird mesh. Point size?

1 Like
@wezrule said:
first I would SHIFT + F11 to clean and rebuild, and see if that fixes the issue. Then I would use the debugger and step through the code until I found where the error was caused

Yup, I tried that before but then there is a huge number of lwjgl calls i have to walk through and i understand none of these.


@androlo said:
I'm guessing this is a weird mesh.

Thanks for that!
Seems that i got the reason...
Ok, not the "reason" but I know that a spatial is causing trouble, when i do not attach it, there's no exception.

Thanks for the advices!

OK!

Just created the model once more but instead of

blender → save .blend → import with jme

i did

blender → export .obj → imort with jme



But I’m pretty sure that’s not a usual problem with importing .blend files.