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

applet loading problem

Milindkumar Shah
Greenhorn

Joined: Feb 11, 2008
Posts: 2
hello to all,

when i try to load applet in browser i got this error :


Java Plug-in 1.5.0
Using JRE version 1.5.0 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\milind


----------------------------------------------------
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 and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------

load: class TestApplet.class not found.
java.lang.ClassNotFoundException: TestApplet.class
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

my Dir. structure is

WEB-INF/classes/applet/TestApplet.class

and code in html is
<applet alt="not load" class="applet.TestApplet.class" height="200" width="200"></applet>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41874
    
  63
Nothing inside of WEB-INF will be served by the servlet container. You need to keep the class files (the "applet" directory in this case) in the directory that contains the HTML files.


Ping & DNS - my free Android networking tools app
Milindkumar Shah
Greenhorn

Joined: Feb 11, 2008
Posts: 2
hello,
Thanks for Reply but still the problem is not solved
now my Dir. Structure is

Inside my App called AppletDemo
folder called WebRoot/applet/TestApplet.class
and my jsp filed located at
WebRoot/jsp/displayApplet.jsp

and code inside the jsp file is

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Wel come to Applet world</title>
</head>
<body>
<table width="100%">
<tr><td align="center">Wel come Milind</td></tr>
<tr>
<td width="100%" align="center">
<applet code="applet.TestApplet.class" width=400 height=400 >
</applet>
</td>
</tr>
</table>
</body>
</html>

Kindly guide me because i try lot for this but i am not finding solution
Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41874
    
  63
You need to keep the class files (the "applet" directory in this case) in the directory that contains the HTML files.


For "HTML" substitute "JSP" in your case.
 
wood burning stoves
 
subject: applet loading problem