java.nio.BufferOverflowException with Ogre mesh.xml

Hello, I exported to Ogre scene from blender 2.57b but can’t load the mesh xml. Here’s the error I receive:



com.jme3.asset.AssetLoadException: An exception has occured while loading asset: Models/Cube.mesh.xml

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:242)

at com.jme3.scene.plugins.ogre.SceneLoader.startElement(SceneLoader.java:268)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)

at com.jme3.scene.plugins.ogre.SceneLoader.load(SceneLoader.java:358)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:240)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:373)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:383)

at mygame.Main.simpleInitApp(Main.java:26)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:223)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:124)

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

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

Caused by: java.io.IOException: Error while parsing Ogre3D mesh.xml

at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:820)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:240)

… 21 more

Caused by: java.nio.BufferOverflowException

at com.jme3.scene.plugins.ogre.MeshLoader.pushAttrib(MeshLoader.java:435)

at com.jme3.scene.plugins.ogre.MeshLoader.startElement(MeshLoader.java:586)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)

at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:815)

… 22 more

Btw, this was from the updated nightly builds too.

nehon said:
We still don't have a proper workflow from Blender 2.57, the preferred way for now id blender 2.49 -> ogre -> jME3.
The blender to ogre exporter for 2.57 is not yet official, and i know there has been a lot of chnages in animation in blender 2.5
I recommend making your model in blender 2.57 (modeling, texturing, rigging) then open it with blender 2.49 (ignoring the warning message) and do you animations in blender 2.49.
Then export to ogre from blender 2.49.
I know it's a bit of a pain, but @Kaelthas is working on a direct workflow from blender to jME3.
Also, once the official blender release is out (2.58 or 2.6 i guess), orgre exporter will surely follow.

from another post

this could be fixed I guess, but there are 2 exporters from Blender 2.57, an official and an unofficial that are is very constant evolution.
We'd like to wait for them to be more stable, and choose the one we are going to support.

I have submitted an issue on the blender2ogre page:

http://code.google.com/p/blender2ogre/issues/detail?id=27



The vertexcount property is incorrectly written and jMonkeyEngine3 importer depends on it

The exception has been fixed in version 0.4.4 of the blender2ogre script for Blender 2.5:

Fixed sharedGeometry vertexcount, compatible with jMonkeyEngine

Download the new version here:
http://code.google.com/p/blender2ogre/downloads/list

You can now export any model from Blender 2.5 and have it work in jME3 without problem