IllegalArgumentException: Expected a Int Value (giving an object a texture)

Hey guys i need help with this, i’m just trying to apply texture on the box object…
and here’s the error :
Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
IllegalArgumentException: Expected a Int Value!

i followed the code that i saw in one of jmonkey tutorials…
please … i’m very new at this. thank you very much

Here’s the Code:
package mygame;

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.texture.Texture;

public class Main extends SimpleApplication {

public static void main(String[] args) {
    Main app = new Main();

public void simpleInitApp() {
    Box one = new Box(1, 1, 1);
    Geometry paddleOne = new Geometry("Box", one);
    Material paddleOneMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    Texture paddleOneText = assetManager.loadTexture("Textures/paddle.jpg");
    paddleOneMat.setTexture("Color", paddleOneText);
    paddleOne.setLocalTranslation(new Vector3f(-4,0,0));

public void simpleUpdate(float tpf) {
    //TODO: add update code

public void simpleRender(RenderManager rm) {
    //TODO: add render code


Can you give the full error?

Is the texture resolution a power of two? (16x16, 32x32, 64x64, etc…)

In the future, don’t bother mentioning an exception without including the stack trace. It’s almost just as good.

600x450 pixels
it’s a jpg

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalArgumentException: Expected a Int value!
at com.jme3.shader.Uniform.setValue(
at com.jme3.material.Technique.updateUniformParam(
at com.jme3.material.MatParam.apply(
at com.jme3.material.Material.render(
at com.jme3.renderer.RenderManager.renderGeometry(
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(
at com.jme3.renderer.queue.RenderQueue.renderQueue(
at com.jme3.renderer.RenderManager.renderViewPortQueues(
at com.jme3.renderer.RenderManager.flushQueue(
at com.jme3.renderer.RenderManager.renderViewPort(
at com.jme3.renderer.RenderManager.render(
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(

Try with a power of two texture. It still gives you an error?

Try replacing this line:
paddleOneMat.setTexture("Color", paddleOneText);
paddleOneMat.setTexture("ColorMap", paddleOneText);

In Unshaded.j3md ths Parameters are defined as follow. Use “ColorMap” instead of “Color”.

MaterialParameters {
    Texture2D ColorMap
    Texture2D LightMap
    Color Color (Color)