java.lang.IllegalArgumentException in setTexture()

Hi everyone,



I had the terrain example working perfectly fine in Eclipse when a forum member advised me to switch over to the JMP Netbeans-based IDE. I did, and while that solved a physics related problem I was having (another thread), it introduced another problem. Even if I replaced all of my code with the tutorial code, as it is exactly on the website, this does not work. Yet it works fine in Eclipse.



The exception is:

[java]SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IllegalArgumentException: The given texture parameter is not set.

at com.jme3.material.Material.clearTextureParam(Material.java:375)

at com.jme3.material.Material.setTexture(Material.java:417)

at jme3test.HelloTerrain.simpleInitApp(HelloTerrain.java:35)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:218)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:138)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:206)

at java.lang.Thread.run(Thread.java:662)[/java]



From the looks of it, this is because the setTexture method runs clearTextureParam (deprecated) instead of clearParam.

No that’s not the issue.

this method is called when you use the setTexture with a null parameter, this means your texture parameter is null…and this means the asset manager did not find it.



How do you load your texture? maybe there is a problem in the path



@Momoko_Fan, @Normen we should throw an exception when the asset manager fail to locate an asset, what do you think?

nehon said:
@Momoko_Fan, @Normen we should throw an exception when the asset manager fail to locate an asset, what do you think?

Yeah, @Momoko_Fan now added AssetNotFoundException and AssetLoadException.

nice :wink:

Yes you guys were right, I was missing a reference to jme3testdata. That explains why it worked in eclipse - I had already set everything up there.



Thanks for the help!