wood burning stoves*
The moose likes Applets and the fly likes Unable to view Applet in client machine. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Unable to view Applet in client machine." Watch "Unable to view Applet in client machine." New topic
Author

Unable to view Applet in client machine.

naga murari
Greenhorn

Joined: Aug 12, 2009
Posts: 7
I have one jsp (Main.jsp) in which i am embedding One.Class file by using the following tag:

<applet codebase = "http://localhost:8080/ExceleRATE/" code="One" height="350" width="650" alt="Applet Not Supported by this Browser" archive="http://localhost:8080/ExceleRATE/dom4j-1.6.1.jar,http://localhost:8080/ExceleRATE/One.jar">

This applet (One.java) reads the XML file and displays the data in tree structure.

I kept the One.class file, and all the jar files in the same folder where jsp is there. All the files are in tomcat/webapps/ExceleRATE (project folder).

This is working fine in the machine where i am running tomcat(for running applets separate setting neet to be made for java.policy file ..that i did in my machine and client machine....), but not working from the different machine, i.e client machine (here my machine will act as server).

I am getting the following error in client machine:

load: class One not found.
java.lang.ClassNotFoundException: One
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://c10831:8080/ExceleRATE/One.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: One
Dump thread stack ...

Can you please help me where I am doing wrong.

Thank in Advance..
naga murari
Greenhorn

Joined: Aug 12, 2009
Posts: 7
hi any body there to help on this....
VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
Try using archive parameter in the applet tag instead of codebase. Jar your applet and mention it's location as value to the archive parameter.


Copy Paste is a design error!!
naga murari
Greenhorn

Joined: Aug 12, 2009
Posts: 7
Hi,

Thanks for your reply. But I tried with that, still it is not working....

can you please help out. I have urgent deliverables.

Thanks in Advance.
murali
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Why did you choose "localhost" as the host for your applet tag? That guarantees it won't work on any computer except the one where the applet is served from.
naga murari
Greenhorn

Joined: Aug 12, 2009
Posts: 7
I want to execute the code from client machines. So I am giving my server name like "http://c10831:8080/ExceleRATE".
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

naga murari wrote:I want to execute the code from client machines.
Of course you do. That's what applets are for.
So I am giving my server name like "http://c10831:8080/ExceleRATE".
So, problem solved?
naga murari
Greenhorn

Joined: Aug 12, 2009
Posts: 7
Problem not solved. can you please help on this.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
I don't think either the "archive" or the "codebase" attributes accept full URLs as values; I think those need to be relative paths.


Ping & DNS - my free Android networking tools app
naga murari
Greenhorn

Joined: Aug 12, 2009
Posts: 7
Hi Ulf,

First Thanks for the Reply.

The same application is working fine if I am executing from my machine by using the URL:
http://localhost:8080/ExceleRATE
. My machine name is c10831 in network. But the same application if I give servername instead of localhost it is not working.
I mean classNotFoundException is coming in my machine also.

Unfortunately I removed the network plug.
I tried with this URL http://c10831:8080/ExceleRATE
. Then it is working. So I am thinking the problem might be with network. I mean Firewalls are Turnon. so I am thinking firewalls to be turnoff.

Is this solution Ulf. or is there any workaround for this. In the above case....how some websites are loading with applets even the firewalls are turn on.

Also I heard that if we execute from Unix machine we will not get this exception. Is this true Ulf..

If will ask our client please turn off the firewall, he will not accept right.....

Ulf...please give me one solution

Thanks in Advance...

Murali
 
jQuery in Action, 2nd edition
 
subject: Unable to view Applet in client machine.
 
Similar Threads
Help launching an applet created in Netbeans environment
Cannot load applet
Applet in JSP
Can't deploy an applet using <applet> tag (open HTTP connection failed)
java.io.IOException: open HTTP connection failed: