wood burning stoves 2.0*
The moose likes Applets and the fly likes java.lang. ClassNotFoundException: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "java.lang. ClassNotFoundException:" Watch "java.lang. ClassNotFoundException:" New topic
Author

java.lang. ClassNotFoundException:

Ulvi Cetin
Ranch Hand

Joined: Mar 03, 2003
Posts: 39
I have a very simple applet yet a strange problem. I am having problem with loading this applet on IE.
Here is the applet code:
public class test extends java.applet.Applet {
public void init() {
System.out.println("initialized");
}
public void start() {
System.out.println("started");
}
public void stop() {
System.out.println("stopped");
}
public void destroy() {
System.out.println("destroyed");
}
}
Here is HTML that loads the applet:
<html><body>
<applet code="test.class" width="1" height="1"></applet>
</body></html>
Here is error I am getting on my Java console:
Error loading class: test
java.lang.NoClassDefFoundError
java.lang.ClassNotFoundException: test
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
I am trying to load this applet from a remote host (not on my computer).
Anybody has any ideas? Suggestions?
Thanks.
Ulvi.
PS. The applet loads fine when the Java plug-in is enabled, but I need to get it working with MS JVM.
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi
where is the .html file u mentioned? is it in different location than test.class file? if it is then u have to mention CODEBASE attribute of the APPLET tag.
let me know if this solves the problem?
regards
maulin
Ulvi Cetin
Ranch Hand

Joined: Mar 03, 2003
Posts: 39
The applet and the html are at the same location. Example: http://www.somehost.com/somesubdir/.
I tried with the codebase attribute also, but it didn't fix it. Also, since they are located in the sub-directory, it is not necessary.
Thx.
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi
is ur applet on some publically accessible host? then sent us the URL.i would try if IE 's MS VM loads the applet.
regards
maulin
Ulvi Cetin
Ranch Hand

Joined: Mar 03, 2003
Posts: 39
Yes, it is accessable from outside. I can see other htmls at that sub-directory. But loading the applet fails for some reason.
Thx.
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
so.....
can u provide that URL to me?
regards
maulin
Ulvi Cetin
Ranch Hand

Joined: Mar 03, 2003
Posts: 39
Ok, found out why it wasn't working. I had to compile the Applet with -target 1.1 parameter, so that (the stupid) IE understand the code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang. ClassNotFoundException: