I've designed a simple applet that works fine on My Windows Xp but when I upload it on my webhost server or run it through any server for e.g. Tomcat It shows the following error in Java Console but no error without server

Java Plug-in 1.6.0_02
Using JRE version 1.6.0_02 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Administrator


----------------------------------------------------
----------------------------------------------------

APPLET tag missing CODE parameter.
java.lang.NullPointerException: name
at sun.applet.AppletClassLoader.getResourceAsStream(Unknown Source)
at sun.applet.AppletPanel$7.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
APPLET tag missing CODE parameter.
java.lang.NullPointerException: name
at sun.applet.AppletClassLoader.getResourceAsStream(Unknown Source)
at sun.applet.AppletPanel$7.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)

I don't understand what code parameter is missing

My html code for it is
<APPLET> code="chat.class" width=650
height=600></APPLET>


You closed your applet tag before your parameters. Basically it's malformed HTML that is causing your problem.

<APPLET[B]>[/B]  code="chat.class" width=650 
height=600></APPLET>

Side note: don't bold your entire message for no reason.

Thnx for ur reply but I didn't get you I don't have any params in my applets

Thnx for ur reply but I didn't get you I don't have any params in my applets

Yes, applets have parameters, like "code". Your tag is not written correctly and I showed you exactly where it was broken.
Using the applet Tag

I tried that The same error persists in magnified form ...Actually I'm embedding the applet in the servlet.....I better try with embed and object tags

The correct applet html code is

<applet code="yourclass.class" height=500 width=500></applet>

Hope it works fine.

Thread is a little old. I doubt they still need help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.