Project runs in compiler but build does not work correctly!

Hi,
I’m new to actually distributing builds of my projects, and I needed one now. The build seemed to run ok (I’ll post the log for the “clean and build”) later, it even said build successful, however when I used the distribution part of the project will not run.

Here is the build log:

The part of the project that currently does not work is the part where I am changing from one Nifty GUI screencontroller to another. In the compiler I can hit run and the game works fine, but the build is a different story. Here are the two screen controllers that interlink:

Class Menu:
http://pastebin.com/18k6Z1Kd

“Hub” Menu:

I can get to the class menu but interchanging from the class menu to the Hub I can click the icons all I want and it doesn’t seem like the next xml will load. As I said, I’m new to builds, so I don’t know why a compiler run would work but a build wouldn’t. Perhaps you could forward a link or something explaining the diff to me?

convert your .obj files to .j3o and use those instead. .obj files (and ogre) are not distributed in the assets.jar file

I see, thanks for the help!

Sadly now that I try it it did not work… My project still wont get past that point even though I converted the globe to .j30 (the only 3D asset in the game)

Here is the new MalwareHub (I added a few things aswell before I tried to build again)

You also have to change the name in your code, right? Like assetmanager.loadModel(“mymodel.j3o”); instead of mymodel.obj

Launch your distribution from console or a bat file, so you can get the stack trace. Always provide a stack trace, otherwise people have to start hitting in the dark.

If you did as advised by normen and still have the problem:

  • don’t know if still the case, but a year ago, under windows, in development mode, the nifty part (or was it the jme splash screen?) was less susceptible to go bonkers due to upper/lower case issues while the distribution was unforgiving everywhere.

How do I launch my distribution from the console? #newb
Like this? http://puu.sh/9s44x/097fc95506.png
I did so but it certainly didnt produce a stack trace.

And as an answer to Normen’s question, I changed it in the code, yes. I’ve deleted the .obj aswell.

Build Log:

Here is the class menu again (The one that cannot transfer to Malware Hub):

This is the malware hub (new):

I still see:

[java]globe = assetManager.loadModel(“Models/World/World_Globe.obj”);[/java]

@wezrule said: I still see:

[java]globe = assetManager.loadModel(“Models/World/World_Globe.obj”);[/java]

That’s so darn weird. I thought I literally copy pasted the class into pastebin, but in netbeans I see:
http://puu.sh/9ssDg/4f9ead006a.png

Whatever, it’s been corrected now, and it still doesn’t work. Could you tell me how to do that stacktrace thing?

http://puu.sh/9ssYS/3a1a64d1b1.png

AHA! Now I’m getting somewhere! I figured out how to use the cmd prompt btw :stuck_out_tongue:

http://puu.sh/9st7y/bdf7a7f8bb.png

That path doesn’t exist. My java installation is all wacked up.

After fixing that, I found this:
http://puu.sh/9stNX/f6a8443f87.png

At the point where I want to go to the main menu. The investigation continues. What does that error even mean? How do I fix that???

I also made another thread over at stack overflow:

what do your xml files look like?

Do you try to pass the assets/Interface folder as a directory to nifty? Because its not a folder in the disto, its a jar. And nifty already has the root of the assets jar as a resource location by default. So all file names you use in nifty have to be relative to the “assets” folder. E.g. “Interface/NiftyGUI/MyStuff.xml”

Atm, I’ve found a workaround by extracting the jar contents of the assets jar and just putting them in the dist under the folder Assets, so it isn’t much of an issue.

I am aware of the situation with the filenames, but could the issue be the fact that I use static variables from main in order to render my globe? I’ve actually set up functions in main which I can use to grab the asset manager and such so I can render stuff in the MalwareHub class rather than keep everything in Main.

I have ACTUALLY realized that the same folder it complains about is the one that I register to my assetmanager in main. THis is what I do:

    assetManager.registerLocator("assets/Interface", FileLocator.class);

http://puu.sh/9wml6/50eed968f8.png

What ACTUALLY happened was that I had registered that locator I talked about earlier to my Asset Manager, which I shouldn’tve had to do.
Subsequently, in my xml I had (accidentally) forgot to put the Interface/ in front of a filename. This worked in the compiler because from Jmonkey’s perspective Assets/Interface was an actual folder, but in the build, everything was supposed to be accessed from that jar. That’s why it was complaining that the Assets/Interface folder didnt exist.

@Dean said: I have ACTUALLY realized that the same folder it complains about is the one that I register to my assetmanager in main. THis is what I do:
    assetManager.registerLocator("assets/Interface", FileLocator.class);</blockquote>

Why do you do this? You shouldn’t have to register any of the assets folders and indeed the assets directory will not exist at deployment time.

It seems like you are doing something very strange and then doing something else strange to work around it.

Edit: Ninja’ed by OP.

@Dean said: http://puu.sh/9wml6/50eed968f8.png

What ACTUALLY happened was that I had registered that locator I talked about earlier to my Asset Manager, which I shouldn’tve had to do.
Subsequently, in my xml I had (accidentally) forgot to put the Interface/ in front of a filename. This worked in the compiler because from Jmonkey’s perspective Assets/Interface was an actual folder, but in the build, everything was supposed to be accessed from that jar. That’s why it was complaining that the Assets/Interface folder didnt exist.

I think I said it already but in nifty you have to use the full path for all names of xml files, images etc., relative to the assets folder. So in your case always “Interface/Nifty/Blah.jpg”… That is in the nifty files and code, each time you reference an asset by name. And you don’t have to register anything for it to work, as pspeed said.