(Resolved) Deploying my first WebStart, how can I find exceptions thrown?

Hello everyone, I tried deploying my first WebStart using JME and JME Physics 2, and after hours of figuring stuff out, I am finally getting my main application window to open for a brief second, then it disappears like an exception occurred.  Does anyone have any ideas of how I can find out what that exception is?  Does the webstart keep a log somewhere?  The app is extending BaseSimpleGame if it matters.  Thanks!

I do not know where and if any logs are kept - but you should be able to debug your application in your IDE of choice - the idea of Java is to write once, run anywhere after all :slight_smile:

If you could originally run your application fine on your own machine/IDE, then the problem is most likely the lack of some libraries. In order to solve this problem I suggest you make a brand new project, add all the necessary source files and then start adding the needed libraries as jar-s to the project. Do not link to other projects in your workspace - just do the libraries by adding jar-s. Once you get your app. to work, go through the web-start creation, making sure you add all the jar-s that are included with your new project. Now it should also work as web-start.

If you did it like this though, I am at a loss and we have to wait for an answer about the logs :slight_smile:

in windows you can enable the Java console in the control panel.

then you will see the logging output and exceptions

I did enable the java console, and it opens with my webstart, but unfortunately it closes with it too. :(  So, I cannot see anything in it.

The application does run in Eclipse, but I have the projects for JME and JME Physics 2 from cvs loaded (not jars).  I am not too familiar java deployment and jars, would a good test be to launch the jars from a command line?  Cause I can't do that either.  I get this error:

D:jmetest>java -jar testgame.jar

Exception in thread "main" java.lang.NoClassDefFoundError: com/jme/app/BaseSimpl


        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(Unknown Source)

        at java.security.SecureClassLoader.defineClass(Unknown Source)

        at java.net.URLClassLoader.defineClass(Unknown Source)

        at java.net.URLClassLoader.access$000(Unknown Source)

        at java.net.URLClassLoader$1.run(Unknown Source)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(Unknown Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClass(Unknown Source)

        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

but the jme.jar (which I confirmed does have the needed class) is in the same directory directory right next to my testgame.jar.  I mostly followed the directions here for making my webstart:


gtzpower said:

I did enable the java console, and it opens with my webstart, but unfortunately it closes with it too. :(  So, I cannot see anything in it.

Thats odd.  Ive *never* seen that happen. Do you mean the Webstart console or just a DOS window?

i think there are settings to keep the console open after the java application ends.

btw. did you see the Wiki entry about webstarting jME Games?

webstart step by step

It is the java console enabled by running javacpl.exe in the jre bin directory, going to the advanced tab, settings tree, java console tree, and selecting show console.  Is there something else you had in mind?  Any idea where the settings are to keep it open?

And that wiki is what I mostly followed to create my webstart up to the jarsigner command (it would fail unless I ran the signer on each jar individually for some reason.  Then, my jnlp was generated using darkfrogs webstart generator at:


I did do some modification to the jnlp after it was generated to get it to work (i really didn't know what I should have entered for some of the fields).  I enabled directory listing on the site so you all can look at what I have if you desire to.


jmetest.jnlp is the file i am launching.  I think I need to add some more jars yet (i noticed that on my work PC, I get an exception "Caused by: java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException", so the opengl(?) jar is still needed i assume).  At home though, the window is created, but before any graphics render, it bombs out.

EDIT:  I just found this. http://www.jmonkeyengine.com/jmeforum/index.php?topic=3000.0  I will give it a look when I get home (its logging my exceptions here at work, but then again, I can see the exceptions here without the log)

the native jar neets to be in the section 'resources os'

  <resources os="Windows">
     <j2se version="1.5+"/>
    <nativelib href="win-nat.jar"/>

Then you are missing the lwjgl.jar, jogg.jar and jorbis.jar  in your jnlp file.

You can either list the lwjgl.jar like the other jme-jars if the lwjgl.jar has the same signature as the jme jars, or you can list it separately as an extension (in a separate jnlp file) if you take the original lwjgl.jar like i did in the wiki.

This webstart stuff is a bit troublesome until you get it to work a few times, it also took me quite a few hours to get the hang of it :)

:smiley: Thank you so much for taking the time to look at this!  I will try this stuff when I get home.  I think you're right though, once I get through it at least one time, I have something I can reference to see what I need to do next time.

Thanks again.  :smiley:

Ok, I got the other stuff added, and I found the logs on my machine with the following error:

<?xml version="1.0" encoding="windows-1252" standalone="no"?>
<!DOCTYPE log SYSTEM "logger.dtd">
  <message>0    [javawsApplicationMain] FATAL odejava  - Native code library failed to load. java.lang.UnsatisfiedLinkError: org.odejava.ode.OdeJNI.get_ODEJAVA_VERSION()Ljava/lang/String;

I tried adding an extension to the odejava jnlp file available from their site, but even that didn't work.  Any tips on what to do from here?  The web server directory is still accessible for anyone who wants to look at my files.  Thanks!

Ode is the native physics library, you need to put odejava.dll also into your windows-native.jar.

that much to platform independence of java …  :slight_smile:

Thanks for your help so far, I really do appreciate it.  I did add in the dll file by copying it into my jmelib directory, then following the tutorial and running

jar cvf windows-native.jar *.dll

I then resigned the jar, and put it online.  I am still getting the same error though.  :?

Any more ideas?

did you verify that the ode dll is really in the jar?

i dont know what it could be else.

I just opened the jar off my site, and it does have 5 dll's, one of which is odejava.dll.  This may be asking a bit much, but do you have a working webstart using odejava somewhere so that I may glance at it and the files associated (like how mine is set up allowing directory listing and such).

Also, I remoted into my work PC, and the error there was different, but it was graphics related (I assume due to remote desktop use).  If you try running my jnlp, does it give you the same error in the logs?


also make sure, that you don't have any directory entries in your native jars.

the only directory is META-INF

Thanks!  I noticed yours wasn't working either, so I decided to drive to work and test mine out on xp there.  IT WORKED!  So, for some reason, it just doesn't work on my PC.  It's Vista if that matters. 

Regardless of whether we figure that out or not, I can deploy and thats all that really matters so long as other vista pc's work!!  I thank you very much for your help and patience.

I give you 5 fro's!

:smiley: :smiley: :smiley: :smiley: :smiley:

Woohoo, I got it running on my pc!  I did a search in C:program filesjava for files with ode in their name…  deleted them all, rebooted, and VOILA!!  It's alive :)  Mwahahaha

Thanks again!

:wink: cool, glad you get it running now