NullPointer Errors in my conversion. Yet it still works

When running my game I get a NullPointerException:

Exception in thread "main" java.lang.NullPointerException
        at com.jmex.model.converters.ObjToJme$MaterialGrouping.<init>(Unknown Source)
        at com.jmex.model.converters.ObjToJme.convert(Unknown Source)
        at fyrestonev05.ModelConverter.convertModel(
        at fyrestonev05.Fyrestone.getChar(
        at fyrestonev05.FyrestoneServer.<init>(
        at fyrestonev05.FyrestoneServer.main(

At the same time, the game runs and my model loads... I know I shouldn't be complaining but I think that this error is leading to other errors that I am having.

ModelConverter: (Problem "bolded" and commented)

public class ModelConverter
    private static final String ninjaDir = "models/ninja.obj";
    private static Quaternion pitch90 = new Quaternion();
    public static Spatial convertModel()
        // Point to a URL of my model
        URL model = Fyrestone.class.getClassLoader().getResource(ninjaDir);
        // Create something to convert .obj format to .jme
        FormatConverter converter = new ObjToJme();
        converter.setProperty("mtllib", model);
        // This byte array will hold my .jme file
        ByteArrayOutputStream BO = new ByteArrayOutputStream();
        try {
            // Use the format converter to convert .obj to .jme
           [BOLDBOLDBOLD] converter.convert(model.openStream(), BO);[BOLDBOLDBOLD]//This is where the error points.
            Spatial myModel = (Spatial) BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
            // shrink this baby down some
            pitch90.fromAngleNormalAxis(FastMath.PI * 1.5f, Vector3f.UNIT_X);
            myModel.setModelBound(new BoundingBox());
            // Put her on the scene graph
            return myModel;
        } catch (IOException e) {   // Just in case anything happens
            System.out.println("Damn exceptions!" + e);
        return null;

Anyone see a problem?
Thank you so much.


Maybe something is wrong with the mtl file or your version of jME…

When I run that with a different model it works fine for me…

Yeah, i have the Obj and the Mtl file.