Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class not found exception ,open HTTP connection failed

 
Venkata Kiran
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai All,
when I try to run my applet in webpage the applet is notinited
& i found the following stacktrace in java Console:


Requesting URL: http://localhost/PCC/Applet/ImgDemo.class

load: class ImgDemo.class not found.

java.lang.ClassNotFoundException: ImgDemo.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

Is this a problem with classpath or OS or my code.
Thank you.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few things to investigate: What does the applet tag look like? Is the HTML page in the same directory as the class file? Can the class file be downloaded manually?
 
Venkata Kiran
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applet tag is
<APPLET height=360 width=500 name="ImgDemo" code="ImgDemo.class" archive="Img1.jar"
codebase="/Inetpub/wwwroot/Pcc">
ImgDemo.class file is in Img1.jar which is in /Inetpub/wwwroot/Pcc.
I even get a dialog box for entering Password
Saying Password Needed Network
Firewall 127.0.0.1
my applet is not signed ? I am having a multipart form upload provision within the same html page ?Is it the cause?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
codebase="/Inetpub/wwwroot/Pcc"

This looks odd. Try placing the jar file in the same directory as the HTML file, and leave out the codebase attribute.
 
Venkata Kiran
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes tried that also with no result.
I am still getting the same error.
(I am using .NET environment so my code base is Inetpub/wwwroot.)
 
Cai DongShan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you use any tool to develop your application? If so, please check if there is any library needed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic