NoClassDefFoundError in Netscape 3


I have a java application that works perfectly fine locally but when I try to execute the application from either the A: drive or the internet, Netscape gives me a "java.lang.NoClassDefFoundError:".

I have definitely uploaded all of the class components - so thats not it.  Does anyone know what this error message means or how to solve my problem?

Thanks,
Craig
boones@gis.net
boonesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

msupinskiCommented:
Are you trying to load the applet into Netscape via a web server,
or are you directly loading the HTML page via the Open File.. dialog??
0
boonesAuthor Commented:
From msupinski: Are you trying to load the applet into Netscape via a web server, or are you directly loading the HTML page via the Open File.. dialog??

The applet works when I directly load the HTML page via the Open File dialog from the C:.

When I try to directly load the HTML page via the Open File dialog from the A: (yes, I have loaded all the class files to the a: drive) or when I try to load the applet into Netscape via a web server I get a NoClassDef... error in Netscape.

Craig Dubrule
boones@gis.net


0
trofCommented:
I suspect, this error has only one mean - ClassLoader on Netscape VM can not found the .class file, described in APPLET tag, so, something wrong with paths. Maybe, you HTML includes full path to class file, something like "C:\\...Something.class" ? So, your Java stuff is OK, possible error is in HTML. Check paths in tags.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

boonesAuthor Commented:
They were good suggestions trof but they are not the answer. I double-checked what you said and it is not the case. The problem is definitely not related to the HTML file.
0
jpk041897Commented:
How are you mapping the address to your applet in the HTML form?

If you are not using a URL, it will not work.

For instance if the Applet tag says:

<APPLET code="A:\YourApplete.class">

or

<APPLET code="YourApplete.class">

you'll get into all kinds of trouble.

The second form will only work if both the HTML file and the applete exist on a Web serve and the first type must be changed to:

<APPLET code="file:///A|/YourApplete.class">.



0
boonesAuthor Commented:
JDK: In my HTML file I have my class reference setup as you have listed <APPLET code="YourApplete.class">. However, with this setup as long as the HTML file is in the same directory as the class file there should be no problems, right?

One additional point, my applet is comprised of 2 separate class files, one of which is an instance of the Applet class and the other is called by the first class.  This may have some effect on the answer. I have uploaded other single class file applets to the net before without a problem. Maybe the problem has something to do with this. Again, both class files and HTML file which calls the Applet derived class file are in the same directory.

0
boonesAuthor Commented:
Adjusted points to 200
0
jpk041897Commented:
All right, with the info you added I was able to duplicate your problem using the JDK fractal demo.

This behavior is only present in Netscape Navigator and does not appear in MS IE or Suns browsers.

To solve your problem you need to use the following syntax:

<APPLET CODEBASE="file:///A|/"  code="YourApplete.class">

Adding CODEBASE to the APPLETE tag instructs Java to search for classes in the specified directory.

Apparently, Netscape does not consider a floppy part of the . (dot) directory in the CLASSPATH environment variable, so adding CODEBASE is the only reasonable alternative.

As it turns out, its the only alternative! No combination of environment variable modifications will solve this one.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
boonesAuthor Commented:
By extensive browsing through the question database I was able to answer this question myself. I do appreciate all who tried to answer my question, I probably did not give enough info.

Anyways, the problem was that I was unaware that a single source code file that contains multiple class definition will compile into multiple class object files each one named with its respective class name.  I assumed that each source file would compile into an object file as in C++. This is not the case with Java.

0
boonesAuthor Commented:
JDK: I'll give you credit for this one - since you were the closest.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.