Error when applying collision

I got an error:
Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
ClassCastException: com.jme3.scene.Geometry cannot be cast to com.jme3.scene.Node

It appears when I load the model that I ripped from minecraft using jMc2Obj. But when I used other models, it works without a problem.

Here is my code, basically it was from the HelloCollision tutorial:

package SlenderMan;

import com.jme3.app.SimpleApplication;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.collision.shapes.CapsuleCollisionShape;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.control.CharacterControl;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.bullet.util.CollisionShapeFactory;
import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.light.AmbientLight;
import com.jme3.light.DirectionalLight;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;

public class Test extends SimpleApplication
implements ActionListener {

private Spatial sceneModel;
private BulletAppState bulletAppState;
private RigidBodyControl landscape;
private CharacterControl player;
private Vector3f walkDirection = new Vector3f();
private boolean left = false, right = false, up = false, down = false;

private Vector3f camDir = new Vector3f();
private Vector3f camLeft = new Vector3f();

public static void main(String args) {
Test app = new Test();
app.start();
}

public void simpleInitApp() {
bulletAppState = new BulletAppState();
stateManager.attach(bulletAppState);

viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f));
flyCam.setMoveSpeed(100);
setUpKeys();
setUpLight();

sceneModel = assetManager.loadModel("Models/Map/map.obj");
sceneModel.setLocalScale(2f);

CollisionShape sceneShape =
        CollisionShapeFactory.createMeshShape((Node) sceneModel);
landscape = new RigidBodyControl(sceneShape, 0);
sceneModel.addControl(landscape);

CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1.5f, 6f, 1);
player = new CharacterControl(capsuleShape, 0.05f);
player.setJumpSpeed(10);
player.setFallSpeed(30);
player.setGravity(30);
player.setPhysicsLocation(new Vector3f(0, 10, 0));

rootNode.attachChild(sceneModel);
bulletAppState.getPhysicsSpace().add(landscape);
bulletAppState.getPhysicsSpace().add(player);

}

private void setUpLight() {

AmbientLight al = new AmbientLight();
al.setColor(ColorRGBA.White.mult(1.3f));
rootNode.addLight(al);

DirectionalLight dl = new DirectionalLight();
dl.setColor(ColorRGBA.White);
dl.setDirection(new Vector3f(2.8f, -2.8f, -2.8f).normalizeLocal());
rootNode.addLight(dl);

}

private void setUpKeys() {
inputManager.addMapping(“Left”, new KeyTrigger(KeyInput.KEY_A));
inputManager.addMapping(“Right”, new KeyTrigger(KeyInput.KEY_D));
inputManager.addMapping(“Up”, new KeyTrigger(KeyInput.KEY_W));
inputManager.addMapping(“Down”, new KeyTrigger(KeyInput.KEY_S));
inputManager.addMapping(“Jump”, new KeyTrigger(KeyInput.KEY_SPACE));
inputManager.addListener(this, “Left”);
inputManager.addListener(this, “Right”);
inputManager.addListener(this, “Up”);
inputManager.addListener(this, “Down”);
inputManager.addListener(this, “Jump”);
}

public void onAction(String binding, boolean value, float tpf) {
if (binding.equals(“Left”)) {
if (value) { left = true; } else { left = false; }
} else if (binding.equals(“Right”)) {
if (value) { right = true; } else { right = false; }
} else if (binding.equals(“Up”)) {
if (value) { up = true; } else { up = false; }
} else if (binding.equals(“Down”)) {
if (value) { down = true; } else { down = false; }
} else if (binding.equals(“Jump”)) {
player.jump();
}
}

@Override
public void simpleUpdate(float tpf) {
camDir.set(cam.getDirection()).multLocal(0.6f);
camLeft.set(cam.getLeft()).multLocal(0.4f);
walkDirection.set(0, 0, 0);
if (left) {
walkDirection.addLocal(camLeft);
}
if (right) {
walkDirection.addLocal(camLeft.negate());
}
if (up) {
walkDirection.addLocal(camDir);
}
if (down) {
walkDirection.addLocal(camDir.negate());
}
player.setWalkDirection(walkDirection);
cam.setLocation(player.getPhysicsLocation());
}
}

Sorry for my english, not my first language.

Well don’t cast to Node if its not a Node…

@normen said: Well don't cast to Node if its not a Node..
How? Is there another way to apply collision? Sorry, I'm new to jmonkey

change → CollisionShapeFactory.createMeshShape((Node) sceneModel);
to → CollisionShapeFactory.createMeshShape(sceneModel);

it works!! thank you so much good sir! =D