Newbie - applying textures

Here's the exception I get following the online tutorial.  The code is pretty simple, so what could be wrong?

java.lang.IndexOutOfBoundsException: 157311
   at java.nio.DirectByteBuffer.get(
   at org.lwjgl.opengl.glu.MipMap.gluScaleImage(
   at org.lwjgl.opengl.glu.MipMap.gluBuild2DMipmaps(
   at org.lwjgl.opengl.glu.GLU.gluBuild2DMipmaps(
   at com.jme.scene.state.lwjgl.LWJGLTextureState.apply(
   at com.jme.util.TextureManager.loadTexture(
   at com.jme.util.TextureManager.loadTexture(
   at com.codecrate.shard.ui.TextureManager.loadTexture(
   at com.codecrate.shard.ShardHack.simpleInitGame(
   at com.codecrate.shard.ShardHack.main(

public class ShardHack extends SimpleGame {

    private final TextureManager textureManager;

    public ShardHack() {
        this.textureManager = new TextureManager();

    public static void main(String[] args) {
        new ShardHack().start();

    protected void simpleInitGame() {
        display.setTitle("Shard Hack");

        Texture texture = textureManager.loadTexture("MetallicTile.jpg");

        TextureState ts = display.getRenderer().createTextureState();

        Sphere s = new Sphere("Sphere", 30, 30, 25);
        s.setLocalTranslation(new Vector3f(0,0,-40));
        s.setModelBound(new BoundingBox());


Also, I extracted the texture loading to a seperate class:

    public Texture loadTexture(String name) {
        return com.jme.util.TextureManager.loadTexture(

pretty sure that it has something to do with the loadTexture call might try sending it a URL,filename,or awt.image not for the loaded .jpg but this is all a guess.  I too am having troubles with TextureManager hope this solves your problem

wireframe, are your textures power of two? If not, scale them to power of two and try again.

I'll check the image size and get back to you tonight.  THanks for the feedback. 

Is there someway for jme to check that the image size is correct to prevent this kind of user error?  should i file a RFE for this?

The trouble is, most modern cards can handle power of two textures just fine, but the glu mipmapping stuff can't seem to. I guess we could put in a check if mipmapping is enabled.

Yep, resizing the image worked for me.  I actually just grabbed the "Monkey.jpg" from the jme tests and it worked great. 

Thanks for your help, i hope it'll be smooth sailing from here on out (for a while at least).