Game will not load

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalStateException: No loader registered for type “”
at com.jme3.asset.ImplHandler.aquireLoader(ImplHandler.java:198)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:271)
at com.jme3.material.Material.(Material.java:120)
at mygame.Main.simpleInitApp(Main.java:27)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Thread.java:744)

You probably don’t create or load your material properly.
Show us the code, at least what’s around that :

mygame.Main.simpleInitApp(Main.java:27)

https://www.mikeash.com/getting_answers.html

But thanks for at least including the stack trace.

package mygame;

import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
//import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
//import com.jme3.*;

/**

  • test

  • @author normenhansen
    */
    public class Main extends SimpleApplication {

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

    @Override
    public void simpleInitApp() {
    Box b = new Box(1,1,1);
    Geometry geometry = new Geometry(“My Box”, b);
    Material mat = new Material(assetManager, “Common Mat/Defs”);
    mat.setColor(“Color”, ColorRGBA.Cyan);
    geometry.setMaterial(mat);
    rootNode.attachChild(geometry);
    }
    @Override
    public void simpleUpdate(float tpf) {

    }

    @Override
    public void simpleRender(RenderManager rm) {
    }
    }

What do you intend to do there?

1 Like

create a 3d cube. im using jmonkey engine sdk 3.0

You haven’t specified a material to load. You should look at the JME tutorials… pretty much any of them but you should really do all of them starting with the first one.

Where did you copy-paste that code from? Try removing all the text in the quotes there and press Ctrl-Space with the cursor in place.

Material mat = new Material(assetManager, “[Ctrl-Space]”);

Looks like it’s character-for-character the base game template… but for some unknown reason he’s removed the material name. Weird.

i was viewing the tutorial and copied it line from line…

“The” tutorial?

Aside from the fact that its not an official tutorial thats not what he wrote in his code:

It creates the material…

No it doesn’t if you only write half of the matdef name.

Man, just replace this line:

Material mat = new Material(assetManager, "Common Mat/Defs");

for this one:

Material mat = new Material(assetManager,  "Common/MatDefs/Misc/Unshaded.j3md"); 

Also, the best way to get started is the official tutorial. I learn all the basics to start developing within 2 hours. You should take a look at:

http://wiki.jmonkeyengine.org/doku.php/jme3:beginner:hello_simpleapplication

so that’s not standard output?

its default input

Thank You. It worked. I was up all last night trying to figure that out…