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: java.io.IOException: Error while parsing Ogre3D dotScene
E/AndroidRuntime(19784): at com.jme3.scene.plugins.ogre.SceneMaterialLoader.load(SceneMaterialLoader.java:149)
E/AndroidRuntime(19784): at com.jme3.scene.plugins.ogre.SceneLoader.load(SceneLoader.java:499)
E/AndroidRuntime(19784): at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:259)
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(ExpatParser.java:545)
E/AndroidRuntime(19784): at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:485)
E/AndroidRuntime(19784): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:309)
E/AndroidRuntime(19784): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:267)
E/AndroidRuntime(19784): at com.jme3.scene.plugins.ogre.SceneMaterialLoader.load(SceneMaterialLoader.java:140)
E/AndroidRuntime(19784): … 7 more

Running it in desktop the xml is properly loaded…

Thanks

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)
{
    dbf.setValidating(false);
}
dbf.parse()....

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