Issue loading ogrexml scene in android

Hi all,

I’m having issues importing an ogrexml scene file in android with the following exception:

E/AndroidRuntime(19784): Caused by: Error while parsing Ogre3D dotScene
E/AndroidRuntime(19784): at com.jme3.scene.plugins.ogre.SceneMaterialLoader.load(
E/AndroidRuntime(19784): at com.jme3.scene.plugins.ogre.SceneLoader.load(
E/AndroidRuntime(19784): at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(
E/AndroidRuntime(19784): … 5 more
E/AndroidRuntime(19784): Caused by: org.apache.harmony.xml.ExpatParser$ParseException: At line 26, column 4: unclosed token
E/AndroidRuntime(19784): at org.apache.harmony.xml.ExpatParser.finish(
E/AndroidRuntime(19784): at org.apache.harmony.xml.ExpatParser.parseDocument(
E/AndroidRuntime(19784): at org.apache.harmony.xml.ExpatReader.parse(
E/AndroidRuntime(19784): at org.apache.harmony.xml.ExpatReader.parse(
E/AndroidRuntime(19784): at com.jme3.scene.plugins.ogre.SceneMaterialLoader.load(
E/AndroidRuntime(19784): … 7 more

Running it in desktop the xml is properly loaded…


It could be that orgre files aren’t supported for Android. Convert your model(s) into .j3o files and try again.

Maybe but it sounds weird that ogre is supported only in some platforms…

Using j3o worked but, after investigating a little more into it because I was using also xml for my own data files and I was having issues also with that.

It seems that there’s some buggy implementation in xml validation in android, so I had to disable it to have my data properly loaded in the following way:

DocumentBuilderFactory dbf...
if ( runningOnAndroid)

Maybe a similar solution could be applied to jme3 so people can use ogrexml on android directly if they want/need to…