Texture loading problem

Hello everyone,

The past few weeks I have been trying myself some framework,s that could allow me to set a concept I have been working on for a game, in motion. After going through some of them, jME seems to be the one that so far is closest to the goals I have… so far.

I have been prowling through them tutorials and Wiki pages… as well as happily browsing the forums. While attempting to mess around with the terrain introduction class of the Wiki, I have hit a snag…

The setup I am using is Windows running a Sun’s JDK (1.6.u07 32Bit VM), based on the NetBeans “getting started” page of jME documentation. I have run nearly all tests from both the jME Pysics 2 as well as the jME itself… so I don’t’ really think its a configuration problem anywhere (although I could be wrong…).

… The program crashes when it reaches the following line from the HelloTerrain tutorial:

(PS: I also tried the so called “up-to-date” version… with same result.)

URL grayScale=jMEtestbench.class.getClassLoader().getResource("jmetest/data/texture/bubble.jpg");

In suspecting that it could be related to resource finding... I commented the call above to the procedure that contained that line. I believed it would "skip" the whole code, just giving my one less terrain block in the rendering window... which was true. But still, the generatedHeightMap() procedure simply refuses to load the texture for the terrain. I have even tried to supply the full pathname to the texture file and still wouldn't work. Any ideas one what might I be doing wrong?

Offtopic: I just hope I don't have to skip another seemingly great freamework because, again, things do not work as expected and nobody knows why...  :'(

jMEtestbench.class ?  i don't see that in the tutorial entry.

The copy pasted code from the Tutorial worked for me :slight_smile:

URL resolution for files is not specific to jME, so don't lose hope just yet. :wink:

Is the jmetest package on your classpath? Are you using the jME source from svn or cvs, or are you using jars that you downloaded?

Core-Dump said:

jMEtestbench.class ?  i don't see that in the tutorial entry.

The copy pasted code from the Tutorial worked for me :)

That may be because I pasted the code in a file I had already open for testing jME stuff in NetBeans... and all references to "HelloTerrain" were automatically changed to match the existing filename... or something... but the rest of the file is an exact copy, but instead of having "HelloTerrain" it has "jMEtestbench".  :lol:

Could you please share some details on your dev. environment so I could.. maybe, compare and see what could possibly be wrong on my end?  :D

@nymon: As soon as I get back to my workstation I will try to again confirm everything, paying special attention to what you pointed. I am using a jME built from the CVS. Just like the "Getting Started" thing...

Edit: Maybe I should point that i dont really have a "jmetest" package, all I ended up with in the end of building the source was a "jmetest" folder where all the resources went... I think I know what is wrong now. Maybe I need to pack it all up on a sort of a "package" ? I read something.. somewhere about making resources packed into jar files...?

Nop, unfortunately all is as stated. Every configuration should be correct… yet it still doesn't work. I even tried packing the jmetest resources into a jar file. To no avail…

I am going to try re-making everything from scratch and clean installs. But this time, I'll use the Eclipse approach… since I haven't, yet, made any serious Java programming I am not yet biased towards any IDE in particular to work with Java…

I'll let you guys know if it solved, or not, my problem. Somehow I get the feeling I'm gonna bury NetBeans for good…  }:-@

OK that's it, thanks for the help guys but it seems somehow, somewhere it was NetBean's fault. I'm taking it out, even more so because Eclipse seems to work faster and be lighter on the system's resources.

Everything is working like a charm now, except some of the jME Physics 2 tests but I believe the errors are probably related to code bugs rather than an ill-setup.

Thanks for everything and be sure ill be stopping by the this forum often!  :smiley:

Good to hear, and welcome to the jME boards. :slight_smile: