Solved

java applets gone crazy

Posted on 1998-02-05
4
197 Views
Last Modified: 2013-11-23
Dear experts

Java has been  acting weird lately;
I am using "visual cafee 2 pro" and "applet marque wizard"as visual tools to develop my applets,so that i don't have to write  a single line of
code..I always make sure that the applets are
in the same directories as the html files, with " code" tag pointing to them.

  I haven't been  able to run a single applet lately(neither on my hard disk nor on the server).I keep getting these error messages:

java.lang.null pointer exception.
or
error javalang no such method.

  Finaly i tried to write my own applet code .I have installed jdk1.1.3 to compile them .I keep getting an error message such as "error......threads"

I have a pentium 200 MMX with 32 meg of edo ram and i am using win95.

Do you think  the problem is caused by the mmx tecknology or something else?
Beside copying the applet class file to the same html file folder,should i copy all  the folders containing class files  (when using symantec visual caffe )
into the same folder as the html file.

Thank you.
Fadi
0
Comment
Question by:fadih
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
froderik earned 120 total points
ID: 1232890
Since you didn't post any code the answers must become general.

MMX shouldn't cause any problems related to Java.

Class files. You will need to copy all class files that your applet uses into the same directory unless the classes are from the standard set of Java classes. (From packages like java.lang and java.io , anything that starts with java normally is supported by the applet browser.) To find out this just check the beginning of your applet code. The import statements tells you which classes the applet needs. (It can't use classes if they are not imported.) My guess is that this is your problem.

java.lang.NullPointerException is thrown whenever you send a method to an object that is null. There is some logical inconsisteny that you must find and do something about. Most probable is that you have forgotten a "new" statement somewhere.

"No such method." Are you getting this message when running the applet? You should get it when compiling the applet. The compiler checks if every method used really exists in the corresponding class.

Error...threads. This kind of message usually means that you haven't set your CLASSPATH correct. It should point to <your_java_dir>\lib\classes.zip to include the standard classes. If it doesn't, nothing will work.

For more specific help I would need your applet code. I would be glad to answer any further related questions.

hope this help
Fredrik
0
 

Author Comment

by:fadih
ID: 1232891
Thank you .Your answer has clarified many things but few
things remain unclear;

1)the "error.....threads" thing.I have the classpath set as you
said but the error still appear.

2)About java.lang.NullPointerException error;you said that is caused by a method being sent to a null... But the code is writen completely by "symantec visual caffe , "applet fx"
and other visual java development tools.How can the code be
wrong?
0
 
LVL 1

Expert Comment

by:froderik
ID: 1232892
1) I suppose the error message says something more than that. It is hard to say anything concrete about error....threads. Could you recreate such a message?

2) Programmers of Java tools make mistakes as well as you and I. That is the problem with using tools. It is hard to find the errors when they occurr for they are almost always quite sofisticated. (Errors that didn't show when they tested the tool.)
0
 
LVL 1

Expert Comment

by:froderik
ID: 1232893
The following are the explanation of NullPointerException in Suns documentation for JDK 1.1.5:

Thrown when an application attempts to use null in a case where an object is required. These include:

*     Calling the instance method of a null object.
*     Accessing or modifying the field of a null object.
*     Taking the length of null as if it were an array.
*     Accessing or modifying the slots of null as if it were an array.
*     Throwing null as if it were a Throwable value.

Applications should throw instances of this class to indicate other illegal uses of the null object.

0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question