LWJGL Forum

Programming => LWJGL Documentation => Topic started by: AGP on May 31, 2009, 20:21:44

Title: What Exactly is Dreaded Error 7?
Post by: AGP on May 31, 2009, 20:21:44
What's the applet error 7 and would it be possible to elaborate the message on future releases? I'm running into it on one of my applets (but not all and I see no difference between the ones that work and the one that doesn't), and it's like hitting a brick wall because there's nothing to point me in the right direction. By the way, the applets that work are in the same directory as the one that doesn't, so that I know it's not a version thing.
Title: Re: What Exactly is Dreaded Error 7?
Post by: kappa on May 31, 2009, 20:59:10
error 7 mean that the application crashed when switching from the applet loader to your applet.

a quick key of what the error codes from the appletloader mean can be seen in the AppletLoader Source, the state relating to the number is printed out in the java console but your right a slightly more meaningful message should be displayed instead of just the number, will consider adding this to the AppletLoader.

Code: [Select]
public static final int STATE_INIT = 1;
public static final int STATE_DETERMINING_PACKAGES = 2;
public static final int STATE_CHECKING_CACHE = 3;
public static final int STATE_DOWNLOADING = 4;
public static final int STATE_EXTRACTING_PACKAGES = 5;
public static final int STATE_UPDATING_CLASSPATH = 6;
public static final int STATE_SWITCHING_APPLET = 7;
public static final int STATE_INITIALIZE_REAL_APPLET = 8;
public static final int STATE_START_REAL_APPLET = 9;
public static final int STATE_DONE = 10;

as for your problem, have a look at the java console, and see if it gives you a more meaningful error as to what the problem is and if any exception is being thrown.
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on May 31, 2009, 22:01:12
Thanks for the response, but the console also only says error 7.
Title: Re: What Exactly is Dreaded Error 7?
Post by: kappa on May 31, 2009, 22:04:57
hmm, bit difficult to tell whats the issue with only that much information, got a link you can post that reproduces the error?
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on May 31, 2009, 22:07:30
Ha-hah, my point exactly! But here you go: http://www.agpgames.com/agpstuff/Racer.html
Title: Re: What Exactly is Dreaded Error 7?
Post by: kappa on May 31, 2009, 22:46:29
hmm, had a look but not really sure what it could be, just seems to stop at that particular point with no meaningful error.

One things I did notice is that it is a pretty big jar, almost 20mb, you could try split it into two jars, racer.jar and data.jar, put all the sounds, images and models in data.jar and the code in racer.jar and see if it makes any difference.
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on May 31, 2009, 22:56:26
Cool, I'll try that, thanks. It's the one song alone that takes 10MB, and I downsampled about as far as I ought to.

EDIT: I made it so that the two jars were each about half the original size, but it did not help, error 7 keeps happening.
Title: Re: What Exactly is Dreaded Error 7?
Post by: kappa on June 01, 2009, 08:43:56
is your Racer class an applet? can you post the code for it? or at least the basic outline of you Racer class?
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on June 01, 2009, 19:02:19
I wouldn't like to, no. Suffice it to say that I have written many applets before. Case in point (and this is much simpler, at least in terns of graphics because the ghosts were so-so to write): www.agpgames.com/agpstuff/RatmanGL.html (http://www.agpgames.com/agpstuff/RatmanGL.html)

And this one uses the lwjgl joystick as well.
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on June 10, 2009, 07:39:56
Okay, the first line of my init() is System.out.println("I'm inside init()."); That doesn't get printed, so how can this error 7 be my applet's fault?
Title: Re: What Exactly is Dreaded Error 7?
Post by: Matzon on June 10, 2009, 09:02:45
you could try and debug the applet ... you know, attach to one and check whats going on ...
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on June 10, 2009, 15:51:30
Attach to one? Could you explain how for me because I learned to program (a decade ago) with a text editor and a command prompt compiler. Not a lot of tools at my disposal. I'm starting to think I ought to use NetBeans but as it is I'm not, so how would I go about debugging? Sorry if the question sounds stupid or simple.
Title: Re: What Exactly is Dreaded Error 7?
Post by: Matzon on June 10, 2009, 16:50:56
quick google: http://www.nakov.com/blog/2008/08/20/debugging-java-applets-in-eclipse/
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on June 11, 2009, 06:20:53
Thanks. I downloaded NetBeans instead because I was told it was much better than Eclipse, and I can't really figure out how to debug, so it hasn't done anything other than annoy me (I find my programming style much more freeing). So to shorten the story: still don't have a clue as to what error 7 is. If you guys have a beta version with more elaborate error messages, PLEASE let me have it.
Title: Re: What Exactly is Dreaded Error 7?
Post by: Matzon on June 11, 2009, 08:40:04
There isn't one. I'll take a look tonight.
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on June 11, 2009, 15:34:16
Thanks a lot.
Title: Re: What Exactly is Dreaded Error 7?
Post by: Matzon on June 11, 2009, 21:11:14
Quote
Fatal error occured (7): Racer
java.lang.InstantiationException: Racer
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:752)
   at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:640)
   at java.lang.Thread.run(Unknown Source)

The problem is that your Racer class cannot be instantiated because it has a non-default constructor. Create a constructor that does not take any arguments (the current one takes a boolean argument).
I dont even understand why you are creating a new instance of Racer in the init code and why the applet has ever worked.

I have updated the AppletLoader to print a stacktrace if one such occurs.
Title: Re: What Exactly is Dreaded Error 7?
Post by: Matzon on June 11, 2009, 21:14:13
btw, to debug:
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on June 12, 2009, 07:32:40
Matzon, thanks a whole lot for both tips. As for there not being a standard constructor, I didn't even know I needed one and the javadocs don't say you do. In the past, all my applets must have had simple constructors. That's one that I might never have figured out myself, pal. So again, thank you for your help.
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on June 12, 2009, 08:29:10
So now I am getting an error 7: null message (hey it's progress!). Anyway, if I could have your updated AppletLoader so see its stack trace it would help a lot because as far as I can tell there should be nothing null in my applet. I appreciate your help and hope not to be bothering you too much.
Title: Re: What Exactly is Dreaded Error 7?
Post by: Matzon on June 12, 2009, 08:54:41
until the next release you can always use the nightly build: https://www.newdawnsoftware.com/hudson/view/LWJGL/job/LWJGL/lastSuccessfulBuild/
Title: Re: What Exactly is Dreaded Error 7?
Post by: AGP on June 13, 2009, 16:31:31
Thanks a lot again.