File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang. ClassNotFoundException:

 
Ulvi Cetin
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1873
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1873
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1873
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so.....
can u provide that URL to me?
regards
maulin
 
Ulvi Cetin
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic