Archived

This topic is now archived and is closed to further replies.

loserkid

[java] This exception is causing me to go insane

Recommended Posts

Greetings, I received this exception and I have absolutely no idea why it is occuring: java.lang.VerifyError: (class: Sys3D/SyS_math, method: _$372 signature: ()V) Expecting to find unitialized object on stack at SyS3D.SyS_modelTest.(SyS_modelTest.java:7) at java.lang.Class.newInstanceO(Native Method) at java.lang.Class.newInstance(Compiled Code) at sun.applet.AppletPanel.createApplet(AppletPanel.java:532) at sun.applet.AppletPanel.runLoader(AppletPanel.java:468) at sun.applet.AppletPanel.run(Compiled Code) at java.lang.Thread.run(Compiled Code) Background: I am writing a 3D engine (in 100% java). I was modifying the rasterization code, then I went to to one of my demo applets (SyS_modelTest) the exception occured. Actually in every demo applet the exception occurs. There are a couple strange aspects about this exception that cause me to go insane: 1. It doesn''t occur in IE only in the applet viewer 2. The code that I modified has nothing to do with the class "SyS_math" (only that it calls a method that was previously tested, which had no exceptions) 3. The exception occured about the 3rd time I tested my modified code. 4. When I remove the modified code, the exception still occurs. 5. This is the line of code in SyS_modelTest.java that exception says it occured at:
  
public class SyS_modelTest extends Applet implements Runnable{
  
So if you could shine some light on this exception, it would be greatly appreciated. JP. Oh... if it makes any difference I am using JBuilder 3 (JDK 1.2) ============================================== I feel like a kid in some kind of store... ============================================== www.thejpsystem.com

Share this post


Link to post
Share on other sites
Hey,
If anyone is still curious about this post, I fixed my problem. In the SyS_math I declared the constructor "private" instead of public because I didn''t want any instances of this class -- this was (oddly enough) causing the exception so I changed the constuctor to public.

Cheers, JP.



==============================================
I feel like a kid in some kind of store...
==============================================
www.thejpsystem.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
it has to be public because the Applet class from which it is extended also has public constructors.

Share this post


Link to post
Share on other sites
well anon, no.
my class SyS_math is a utility class and uses static methods (ie SyS_math.cos()).
The class worked with the constructor being private before the exception occured.Meaning I had written the applet SyS_modelTest before I modified the code, which some how (I haven''t figured it out) caused the exception. By changing the constructor to public from private, I merely got around the problem, but didn''t solve it.

Thanks, anyways.
JP.

==============================================
I feel like a kid in some kind of store...
==============================================
www.thejpsystem.com

Share this post


Link to post
Share on other sites
Thanks, Neurotic for your suggestion. I honestly didn''t think of that tell you mentioned it -> good idea.

JP.

==============================================
I feel like a kid in some kind of store...
==============================================
www.thejpsystem.com

Share this post


Link to post
Share on other sites