• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet will not load, NoClassDefFoundError (more, please read)

 
Alex Gorh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've found several other threads on this, but none seem to describe the problem that I am having to the degree to which I am having it
My applet loads just fine in IE browsers on computers that have Java 1.4 installed.
On regular computers, I get:
Error loading class: LED
java.lang.NoClassFoundError
java.lang.ClassNotFoundException: LED
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
at com/ms/applet/AppletPanel.run (AppletPanel.java)
at java/lang/Thread.run (Thread.java)
It looks like Java class loader can find my applet class just fine, while MS loader is having problems. Why is this?
I understand that there is a good chance that my applet uses stuff that is not supported by MS implementation of the JVM. However, wouldn't that throw a different kind of exception? The one that I am getting seems to say that the class loader cannot even find my LED.class file!
I have tried all kinds of combinations with CODEBASE and CODE parameters. I have tried moving LED.class into various folders, including the same folder as the HTML page that is calling it. Nothing works. Bad CODEBASE or CODE parameters make all computers throw exceptions. Good ones make comps with JDK pull the applet up, and ones without it throw the above exception.
I have run out of ideas at this point. Does the MS JVM actually find the applet, but cannot run it? Why would it throw ClassNotFound exceptions then? Or is it unable to find the applet for some funky reason? Please help. I would greatly appreciate any ideas you can give me, even if you do not know "The Answer" ...
 
Alex Gorh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
update:
I tried to create the most simple applet. It imports java.applet.Applet, extends Applet and spits out "Init" "start" and "stop" to the console.
Same problem.
I suppose there is a chance MS JVM has version compatibility problems running applets that extend my version of java.applet.Applet.... but again, it looks like it simply cannot find it. Please help...
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alex
try to install SUN JRE and enable it in IE and see if it works. I have had the similar problem when I used to use MSVM in IE but when I used SUN JRE, it was solved.
See if it works for you as well.
Regards
Maulin
 
Alex Gorh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. I spent quite a bit of time researching this problem on the internet, and I seem to have found the answer.
Even though classes and methods that I used for both appplets were available in earlier versions of Java, MS JVM loader simply cannot recognize them. I recompiled all of my applet .class files using:
javac -target 1.1 MyClass.java
Everything started working! This is great, because downloading and installing stuff on client's PCs is a big no-no for our application. I am very happy that I was able to figure this out, as my applet was about to get canned
I will still need to work around several newer methods that I used in my applet, and figure out why getCodeBase() returns a funky URL. Other than that, I'm good to go!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic