Nullpointer when loading .3ds file

Hi,

After grabbing the latest cvs i get this stacktrace when loading a simple .3ds shape.

java.lang.ExceptionInInitializerError

at heroquest.defaults.Maps.getDefaultWallMap(Maps.java:63)

at heroquest.world.WorldMap.getDefault(WorldMap.java:58)

at heroquest.game.SimpleLauncher.simpleInitGame(SimpleLauncher.java:63)

at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:466)

at com.jme.app.BaseGame.start(BaseGame.java:56)

at heroquest.game.SimpleLauncher.main(SimpleLauncher.java:107)

Caused by: java.lang.NullPointerException

at com.jme.util.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:395)

at com.jme.util.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:386)

at com.jme.scene.SceneElement.read(SceneElement.java:758)

at com.jme.scene.Spatial.read(Spatial.java:685)

at com.jme.scene.Geometry.read(Geometry.java:735)

at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:218)

at com.jme.util.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:395)

at com.jme.util.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:386)

at com.jme.util.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:447)

at com.jme.scene.Node.read(Node.java:660)

at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:218)

at com.jme.util.export.binary.BinaryImporter.load(BinaryImporter.java:132)

at heroquest.util.ModelPool.load(ModelPool.java:84)

at heroquest.world.terrain.Wall.<clinit>(Wall.java:33)

… 6 more

I had no problems loading it from my previous cvs checkout (which was several weeks old)

This is my code that triggers the exception

public Savable load(URL url)
{
if(url == null)
throw new IllegalArgumentException("Can not load null model.");
Savable temp = models.get(url);
if(temp == null)
{
FormatConverter converter = getConverter(url.toString());
if(converter == null)
throw new IllegalStateException("No converter registered for " + url);
ByteArrayOutputStream BO = new ByteArrayOutputStream();
BinaryImporter importer = BinaryImporter.getInstance();
try
{
TextureKey.setOverridingLocation(textureDir);
converter.convert(url.openStream(), BO);
temp=importer.load(new ByteArrayInputStream(BO.toByteArray()));
models.put(url, temp);
}
catch (IOException e)
{
log.log(Level.SEVERE,e.getLocalizedMessage(),e);
}
}
return temp;
}

I store several models in a modelpool since i don't add them to the scene directly but rip out the vertices and stuff and mix it together and create my own trimesh.
the getconverter call returns a max2jme converter in this case ModelPool.getInstance().load(Wall.class.getResource("/pilar.3ds").
Anyone have an idea?

That seems to be caused by the contributed importer changes I have checked in - I'll have a look.

The NPE is fixed. But I'm not sure that it solves the actual problem. If you still have problems please post an example 3ds file.

Thanks Irrisor, the npe is gone and the model loads just fine.