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

Cannot load applet

rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Hello to all,

I am developing an application, using JSF, in which I have used applet to upload the directory. But I am not able to load that applet in the browser.

My code is


It gives me error on the Browser's Java Console



I have created a jar file, sign it and put it in to the lib of my application.
I have also tried to change the codebase to my lib folder

Thanks in advance.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Use 'archive' attribute for loading the jar file.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Sagar Rohankar wrote:Use 'archive' attribute for loading the jar file.


Yes, I have tried with "archive" attribute of applet but it gives me same error.
I think there is problem with codebase. How can I set the codebase to my jar file.

Thanks.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Well, firstly I would suggest you to try using simple "applet" html tag and go through the basic applet configuration, also ponder on this basic cause:

Do you have that class available there, also google for the basic Java Applet example.
rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Hello Sagar,

I have tried the same applet code on the simple HTML page, it worked perfectly. I think because path to archive file is correct.
But when I insert the same code with JSF component, it gives the error.

I have placed the jar file in the lib folder and used archive as an attribute in the plugin tag to the jar file of applet code. Gives same error.
Also tried to put class file in to the classes folder to load applet, again gives same error.

thanks for reply.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

rajshkhr pandey wrote:Hello Sagar,

I have tried the same applet code on the simple HTML page, it worked perfectly.

OK, fine, then copy that same folder having the HTML file into your web app root folder, like.

and access the html file as,
http://localhost:8080/MY_APP/YOUR_HTML_DIR/yourhtml.html

If this works then, you can have an idea what you need to setup for JSP/JSF file
 
 
subject: Cannot load applet
 
Similar Threads
Calling an applet in a JSP page
playing audio in an applet and embedding that applet into a jsp or Html file
Applet in JSP
Calling applet which loads JasperPrint from jsp
a simple examples cannot work.