File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in loading Applet from JSP

 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the applet tag from the HTML page and the directory layout of the files on the server.
 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my directory structure:




My jsp code:

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure the applet class is a public class.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
load: class NewApplet.class not found.

Is the class name really "NewApplet"? In your first post you used "NewJApplet".
 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic