wood burning stoves 2.0*
The moose likes Applets and the fly likes Error in loading Applet from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Error in loading Applet from JSP" Watch "Error in loading Applet from JSP" New topic
Author

Error in loading Applet from JSP

Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 151
i tried to launch an applet from a jsp file.But i'm getting some error.Can anyone help me in solving the problem..



thanks all!!!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
Post the applet tag from the HTML page and the directory layout of the files on the server.


Ping & DNS - my free Android networking tools app
Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 151
This is my directory structure:




My jsp code:

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
Nothing that's inside of "WEB-INF" will be served to the client. You need to move all classes and jar files used by the applet into a publicly accessible directory. The best choice is probably the same directory the JSP file is in.
Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 151
So , i have to place the package containing applet class files and its supporting jar file in the place where jsp file is ?
Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 151
I have placed class files where the jsp files are, but still i'm getting the same error

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

Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Make sure the applet class is a public class.


Swastik
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
load: class NewApplet.class not found.

Is the class name really "NewApplet"? In your first post you used "NewJApplet".
Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 151
Its NewApplet.In my first post in made a mistake.Now i corrected it.Even then i'm getting the same error.

it contains some error like :


why does it comes?due to any settings problem?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
Just to make sure, you have this:

as the JSP page, and the file "NewApplet.class" is in the exact same directory as the JSP page?

Can you download the class file manually by pasting its URL in the browser?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in loading Applet from JSP
 
Similar Threads
Calling an applet in a JSP page
Applet not getting initialized
Problem running an applet
class not found error
java.io.IOException: open HTTP connection failed: