Solved

java applets gone crazy

Posted on 1998-02-05
4
196 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Understanding websocket example in spring 1 57
VB Script to add site to Java Exception List 4 53
nextBoolean(double p) for Random class 3 35
MySQL  on Tomcat 8 30
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now