Load class not found / Http connection failed

Im trying to run an applet on the remote server and it throws me this error

Java Plug-in 1.6.0_01

Using JRE version 1.6.0_01 Java HotSpot(TM) Client VM

User home directory = C:\Users\VSAG

-

c:clear console window

f:finalize objects on finalization queue

g:garbage collect

h:display this help message

l:dump classloader list

m:print memory usage

o:trigger logging

p:reload proxy configuration

q:hide console

r:reload policy configuration

s:dump system and deployment properties

t:dump thread list

v:dump thread stack

x:clear classloader cache

0-5: set trace level to <n>

-

basic: Stopping applet ...

basic: Removed progress listener: sun.plugin.util.GrayBoxPainter@1e2ca7

basic: Finding information ...

basic: Releasing classloader: sun.plugin.ClassLoaderInfo@453807, refcount=0

basic: Caching classloader: sun.plugin.ClassLoaderInfo@453807

basic: Current classloader cache size: 1

basic: Done ...

basic: Joining applet thread ...

basic: Destroying applet ...

basic: Disposing applet ...

basic: Quiting applet ...

basic: Joined applet thread ...

basic: Referencing classloader: sun.plugin.ClassLoaderInfo@453807, refcount=1

basic: Added progress listener: sun.plugin.util.GrayBoxPainter@10ab09f

basic: Loading applet ...

basic: Initializing applet ...

basic: Starting applet ...

basic: completed perf rollup

network: Connecting http://<remoteserver>/ChatClient.class with proxy=DIRECT

network: Connecting http://<remoteserver>/ChatClient.class with cookie "JSESSIONID=1CD43BE6899FCBE664039C2AF23A7CB9"

network: Connecting http://<remoteserver>/ChatClient.class with proxy=DIRECT

network: Connecting http://<remoteserver>/ChatClient.class with cookie "JSESSIONID=1CD43BE6899FCBE664039C2AF23A7CB9"

network: Cache entry not found [url: http://<remoteserver>/class.class, version: null]

network: Connecting http://<remoteserver>/class.class with proxy=DIRECT

network: Connecting http://<remoteserver>/class.class with cookie "JSESSIONID=1CD43BE6899FCBE664039C2AF23A7CB9"

load: class /<path>/ChatClient.class not found.

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

basic: Exception: java.lang.ClassNotFoundException: ChatClient.class

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

I use the embed tag to run the applet

<OBJECT

classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"

width="615" height="360"

codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,mn">

<PARAM name="code" value="${contextPath}/ChatClient.class">

<PARAM name="archive" value="${contextPath}/ChatClient.jar">

<PARAM name="type" value="application/x-java-applet;version=1.4">

<PARAM name="scriptable" value="true">

<param name="username" value="abc">

<param name="port" value="42412">

<COMMENT>

<EMBED type="application/x-java-applet;version=1.4"

width="320" height="410"

code="${contextPath}/ChatClient.class" archive="${contextPath}/ChatClient.jar"

pluginspage="http://java.sun.com/j2se/1.4.1/download.html"

username="abc"

port="42412">

<NOEMBED>

No Java 1.4 plugin

</NOEMBED></EMBED>

</COMMENT>

</OBJECT>

Im new to the web programming and there are possibilities of any kind of silly mistakes.

Thanks in Advance

[5589 byte] By [Supernusa] at [2007-11-27 6:15:19]
# 1
load: class /<path>/ChatClient.class not found.
corlettka at 2007-7-12 17:25:46 > top of Java-index,Java Essentials,Java Programming...
# 2
Sorry, I didnt get what you are about to say
Supernusa at 2007-7-12 17:25:46 > top of Java-index,Java Essentials,Java Programming...
# 3

Umm it can't find your applet class... it did say so, you just didn't believe it. Put the class in the same directory as the html page or specify the codebase (from memory, so read the doco) attribute of the applet tag like

codebase="../applets" class="Whatever.class"

Why on earth would you want to use a GUID? Aren't we trying to get away from such microsilly ideas?

corlettka at 2007-7-12 17:25:46 > top of Java-index,Java Essentials,Java Programming...
# 4

Many thanks for the reply. My jar file is in the same directory as that of the html file. if i expand the jar file, the class file is inside a folder called client. With this scenario I have created the applet tag like

<applet code = "ChatClient.class" archive="ChatClient.jar" width = 320

Height = 410>

</applet>

When I tried this it is still giving me the same error. Im still in the learning phase, so im really sorry for bothering

Supernusa at 2007-7-12 17:25:46 > top of Java-index,Java Essentials,Java Programming...
# 5

> if i expand the jar file, the class file is inside a folder

> called client.

You should set it up this way if, and only if, you declared your applet to be in the "client" package. And if you did that, then the name of your applet would be "client/ChatClient.class" -- I think. I don't do applets and I have no idea why beginners let themselves be sucked into trying them.

DrClapa at 2007-7-12 17:25:46 > top of Java-index,Java Essentials,Java Programming...
# 6
Thanks for the reply. I have declared the applet class inside the client package. I tried client/ChatClient.class but it didnt work for me.
Supernusa at 2007-7-12 17:25:47 > top of Java-index,Java Essentials,Java Programming...
# 7

I think i kind of figured out the problem but not sure whether it might be the reason. I tried executing the jar file that i have created using eclipse by double clicking it. when i did that it said that the main class attribute is not defined. I have no main function in my applet code so i was not able to define the attribute.

Can this affect the execution of applet on the client. Can somebody guide me on this.

Thanks in advance

Supernusa at 2007-7-12 17:25:47 > top of Java-index,Java Essentials,Java Programming...