Applet load failure
I'm trying to load an applet from HTML without success on a particular browser( The browser is actually an internal one based on IE). The applet works on IE and Netscape but here's what I got on the internal version
Error loading class: AppletButton
java.lang.NoClassDefFoundError
java.lang.ClassNotFoundException: AppletButton
at com/ms/vm/loader/URLClassLoader.loadClass
at com/ms/vm/loader/URLClassLoader.loadClass
at com/ms/applet/AppletPanel.securedClassLoad
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run
Some of you may have seen this before and might have some ideas, I have an inkling it has something to do with security of some thing, should I have to set up some sort of server and if so how?? (access the class via http or something like that) . At present the class is in the same location as the html, on my hard drive.
Here'e the html , very very basic
<HTML>
<HEAD>
<TITLE>Using the Applet Tag</TITLE>
</HEAD>
<BODY>
<H1>An Applet that Displays Text at a Designated Location</H1>
<APPLET CODE="AppletButton.class" CODEBASE="." ARCHIVE="applet.jar" HEIGHT=300 WIDTH=300>
Text displayed by browsers that are not Java-enabled.
</APPLET>
</BODY>
</HTML>
[1629 byte] By [
ireland] at [2007-11-19 18:24:28]

# 4 Re: Applet load failure
I had such problem when "main class" was in a package
For example:
(IE 6)
<applet code="GraphHelper.class" archive=".\GHApplet.jar"></applet>
GraphHelper.class was in the package "myapplet".At attempt loaded html page, I catch exception java.lang.ClassNotFoundException!
The problem is resolved so:
<applet code="myapplet.GraphHelper.class" archive=".\GHApplet.jar"></applet>
XCHG at 2007-11-10 2:24:05 >

# 6 Re: Applet load failure
Have you tried putting all your classes into a package or packages?
In the past I have had similar problems in web applications where classes that were not in a package could not be found - and in any case, it's good Java practice.
Writing code has a place in the human hierarchy worth somewhere above grave robbing and beneath managing...
Gerald Weinberg
dlorde at 2007-11-10 2:26:06 >
