Mesh.xml model

My model name is drawers.mesh.xml . When i try to load it via loadModel() function, it throws an exception. So I tried to validate the xml file, and the console printed



XML validation started.

Checking file:/assets/Models/drawer.mesh.xml…

Content is not allowed in prolog. [1]

XML validation finished.



How do I fix this?

I’m not sure the xml actually validates, I wouldn’t worry about it. Posting the actual error you got will shed light on your problem.

the error i get at runtime is:



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

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

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

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

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

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

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

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

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

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

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

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

… 7 more

Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)

at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:998)

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

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

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

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

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

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

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

at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)

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

… 8 more

Sounds like a corrupted file.



How did you create it? What modelling tool, export script, etc.

Also, can you post the mesh.xml file contents here?

I used 3ds max with Ogremax plugin to export

I am having this exact same problem. Any solution???