Texture loading on models broken?

This is freaking me out.  I had my model loader working perfectly a few days ago.  I have not changed anything in my code.  Yesterday and today, every time I try to load any model, I get



May 7, 2008 5:58:16 PM com.jme.util.resource.ResourceLocatorTool locateResource

WARNING: Unable to locate: /C:/Program Files/Java/jdk1.6.0_03/bin/Crusade/Models/Male1/Male1kop.bmp



This happens for every model I try to load (with different BMPs of course).  As I said, I have not changed my code since it was working, and I have not downloaded a new version of jME.



Yes, the BMP is actually there.  I suspect the extra slash before C:/ isn't supposed to be there, but I have no idea how to fix it.  The model file is in the exact same place ad the BMP and loads perfectly.  Just in case, the code segment I use for model loading:


{
Spatial model = null;
try
   {
   URL file = PlayerNode.class.getClassLoader().getResource("Models/Male1/Male1.jme");
   BinaryImporter importer = new BinaryImporter();
   model = (Spatial)importer.load(file.openStream());
   model.setModelBound(new BoundingBox());
   model.updateModelBound();
   model.setLocalScale(.3f);
   }
catch (IOException e) {;}
attachChild(model);
}

So you say the model still loads correctly, it's just that you get the warning?

That's usually because jME dislikes loading resources from direct paths (like "C:…texture", etc). To fix it, jME must be able to locate the texture using the resource locator classes.

See this thread: http://www.jmonkeyengine.com/jmeforum/index.php?topic=5707.0

I actually think he is saying the texture does not load… You should try re-building your .jme file from the original model.

you could also apply the texture directly to the object, the UV coordinates should still be intact.  So just get the object then create a texture state, load that texture and apply it to the object.  (I know this is a workaround, and I have yet to figure out how to do it for objects with multiple textures)

duenez is right, only the texture does not load…the model itself does.  I've tried loading many different models, but none have textures.



I tried rebuilding the original jME, using com.jmex.model.util.ModelLoaderUtil, and it displayed the correct model and texture.  It only skips on the texture when I run it from my main program, which is weird because it used to work perfectly before and I have not changed anything in it.



I'll try ResourceLocator, but isn't that included in BinaryImporter? (which I use to load the model)



I should probably update my jME and see what happens.  If all else fails, I'll cut+paste code from the ModelLoaderUtil until I can fix this.

Just load the model and texture from jar file, you should probably do this for distribution anyway.



The texture is trying to load (the resource locater tool runs and tries to find it), it just can't load from the location you specified.