This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Applets and the fly likes class not found exception ,open HTTP connection failed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "class not found exception ,open HTTP connection failed" Watch "class not found exception ,open HTTP connection failed" New topic
Author

class not found exception ,open HTTP connection failed

Venkata Kiran
Ranch Hand

Joined: Sep 06, 2005
Posts: 30
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
Marshal

Joined: Mar 22, 2005
Posts: 42364
    
  64
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?


Ping & DNS - my free Android networking tools app
Venkata Kiran
Ranch Hand

Joined: Sep 06, 2005
Posts: 30
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
Marshal

Joined: Mar 22, 2005
Posts: 42364
    
  64
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

Joined: Sep 06, 2005
Posts: 30
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

Joined: Dec 07, 2004
Posts: 102
Do you use any tool to develop your application? If so, please check if there is any library needed.


Best Regards,<br />DongShan<br /> <br />SCJP1.4, SCWCD1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class not found exception ,open HTTP connection failed