ClassCastException from Model Loading Tutorial

I am going through the jME tutorials, and I have run into a problem in the "Hello Model Loading" tutorial (which is

Here's the code I have:

package tuts;

import java.util.logging.Level;
import java.util.logging.Logger;

import com.jme.bounding.BoundingSphere;
import com.jme.scene.Node;
import com.jme.util.export.binary.BinaryImporter;
import com.jmex.model.converters.FormatConverter;
import com.jmex.model.converters.ObjToJme;

public class HelloModelLoading extends SimpleGame {
   private static final Logger logger = Logger.getLogger(HelloModelLoading.class.getName());
   public static void main(String[] args) {
      HelloModelLoading app = new HelloModelLoading();

   protected void simpleInitGame() {
      // Point to a URL of my model
      URL model = HelloModelLoading.class.getClassLoader().getResource("jmetest/data/model/maggie.obj");
      // Create something to convert .obj format to .jme
      FormatConverter converter = new ObjToJme();
      // Point the converter to where it will find the .mtl file from
      converter.setProperty("mtlib", model);
      // This byte array will hold my .jme file
      ByteArrayOutputStream BO = new ByteArrayOutputStream();
      try {
         // Use the format converter to convert .obj to .jme
         converter.convert(model.openStream(), BO);
         Node maggie = (Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
         // Shrink this baby down some
         maggie.setModelBound(new BoundingSphere());
         // put her on the scene graph
      } catch (IOException e) {
         // Just in case anything happens
         logger.logp(Level.SEVERE, this.getClass().toString(), "simpleInitGame()", "Exception", e);

Pretty sure it's the same as the tutorial, but when I try to run it, I get a java.lang.ClassCastException on line 40, which is this line:

Node maggie = (Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));

Here's the full exception text:

SEVERE: Exception in game loop
java.lang.ClassCastException: com.jme.scene.TriMesh cannot be cast to com.jme.scene.Node
at tuts.HelloModelLoading.simpleInitGame(
at tuts.HelloModelLoading.main(

Am I doing something wrong? is there a bug? or are the tutorials just not up to date with the trunk from SVN which I grabbed two days ago?


I tried using MaxToJme, (with my own .3ds file) and it worked fine. But then I tried it with my own .obj file (instead of the one from the tutorial) and I got the same ClassCastException.