• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown

java: ClassNotFoundException

Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
I have written a simple applet which looks like:
import java.applet.Applet;
import java.awt.Graphics;
public class FirstApplet extends Applet
public FirstApplet()
public void paint(Graphics g)
g.drawString("Hellow World", 25, 50);
And to run this applet the required html code is
<TITLE> New Document </TITLE>
<APPLET CODE="FirstApplet.class" width="150" height="150">
On Local machine when I am trying to open the html file, it loads the applet and works fine.
But now if I am putting all these on server (Apache-Tomcat) and trying to execute it then it gives me the error in java console as:
Java(TM) Plug-in: Version 1.4.0_03
Using JRE version 1.4.0_03 Java HotSpot(TM) Client VM
User home directory = C:\WINNT\Profiles\am007431.MAHINDRABT
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system properties
t: dump thread list
x: clear classloader cache
0-5: set trace level to <n>
load: class FirstApplet.class not found.
java.lang.ClassNotFoundException: FirstApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 11 more

I put my class file in '/WEB-INF/classes' folder and instead of html page I am using jsp page which is in '/jsp' folder.
Can any one help me out to solve this problem.
It's urgent !
Thanks in advance..
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is for classes used by the servlets and/or JSPs. It's not the place to put applet code. Try putting the applet class in the same dir as the jsp (is the /jsp folder).
A better idea even would be to have /jsp and /applet directories. Put hte jsp in the /jsp dir and put the applet code in the /applet dir then in the jsp you would have:

Let's get him boys! We'll make him read this tiny ad!
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic