• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Unable to view Applet in client machine.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi any body there to help on this....
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
naga murari
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 27995
94
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to execute the code from client machines. So I am giving my server name like "http://c10831:8080/ExceleRATE".
 
Paul Clapham
Marshal
Posts: 27995
94
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem not solved. can you please help on this.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think either the "archive" or the "codebase" attributes accept full URLs as values; I think those need to be relative paths.
 
naga murari
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

for eg: http://c10831:8080/ExceleRATE.

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
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic