wood burning stoves 2.0*
The moose likes Applets and the fly likes Applet not getting initialized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Applets
Bookmark "Applet not getting initialized" Watch "Applet not getting initialized" New topic
Author

Applet not getting initialized

Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
I have a jsp page (myPage.jsp) in

D:\Tomcat\webapps\jsp-examples

here is the code of this jsp

and here is my Java applet (MyApplet.java) in D:\Tomcat\webapps\jsp-examples\WEB-INF\classes\sample


When I call my JSP page, I get the message : Loading Java applet failed.

If i right click on it, the message in the console is

load: class sample.MyApplet not found.

java.lang.ClassNotFoundException: sample.MyApplet

at sun.applet.AppletClassLoader.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)

... 10 more


Can someone please tell me how to resolve this.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
The servlet container will not serve anything out of WEB-INF, so the browser can't get at the class files. Put the sample directory into the jsp-examples directory, then it should work.


Ping & DNS - my free Android networking tools app
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
Thanks a lot.
 
GeeCON Prague 2014
 
subject: Applet not getting initialized