File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Problem in loading applet in IE - Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Problem in loading applet in IE - " Watch "Problem in loading applet in IE - " New topic
Author

Problem in loading applet in IE - " 'CODE' Parameter" for jre1.5

Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Hi,

I am using jre version 1.5 for IE & am tryin gto load the applet thr' the browser. But it is giving me these exceptions & is showing "Applet notinited".

The exceptions it is showing are:

APPLET tag missing CODE parameter.
java.lang.NullPointerException: name
at sun.applet.AppletClassLoader.getResourceAsStream(Unknown Source)
at sun.applet.AppletPanel$6.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)
java.security.AccessControlException: access denied (java.awt.AWTPermission accessClipboard)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkSystemClipboardAccess(Unknown Source)
at sun.awt.windows.WToolkit.getSystemClipboard(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I have also signed the jar file but then also it is giving me access denied exception....

Plz can anybody help me out.

Thanx.

Regards,
- Neha
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Neha,
For applets, you need to have following syntax .

<APPLET CODE = "wjhk.jupload.JUploadApplet" ARCHIVE = "wjhk.jupload.jar" WIDTH = "600" HEIGHT = "400">
</APPLET>

are you passing on all the values?


Does your applet works with 'appletviewer'
syntax for appletviewer is as follows

appletviewer yourappletname.html

check it out.
Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Hi Rajendar,
Yes I am able to run my applet thr' appletviewer. It was also being loaded thr' browser when I was using jre1.4.2_06. This problem is encountered when I am loading it using jre1.5.

Plz can you suggest me a solution.

Thanx.

Regards,
- Neha
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Neha,
Jre1.5 is to be used with jdk1.5 ? did u check out your classpath ?
you r running the jdk1.4 with jre1.5 ? it may not work . am not sure..
and did u enabled the javaTM plugin via control panel ,if u r working on windows?
Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Yes Rajendar,

I am using jdk1.5.0 with jre1.5.0.
The Java PlugIn is also enabled.

Now it is giving me these exceptions....

load: class classname not found.
java.lang.ClassNotFoundException: classname
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



The class name here indicates the class name of my applet....

Do you knw why is this happening???

Thanx.

- Neha
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Neha,
This error indicates that the applet is not able to find the class.

whts the syntax you used for Applet tag.
<applet code=class-filename
[codebase=directory-URL] width=area-width height=area-height [archive=jar-file-URL] [name=ID] [additional-attributes] ... >

class-filename should be given the full name ,including the .class extension too.

or
check the case and location of the .class file on the Web server

or else

There may be a mismatch between the version of the Java SDK that the applet was created with and the version of the Java RE (run-time environment) locally environment installed. This is only an issue if the applet was created with a later version of the Java SDK than the local Java RE. Note: This only seems to be a problem with Internet Explorer
Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Hey Rajendar,

Even the applet code is written properly... Now there's some new problem. It is giving me these exceptions:

APPLET tag missing CODE parameter.
java.lang.NullPointerException: name
at sun.applet.AppletClassLoader.getResourceAsStream(Unknown Source)
at sun.applet.AppletPanel$6.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)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.progressUpdate(Unknown Source)
at sun.plugin.util.ProgressMonitor.updateProgress(Unknown Source)
at sun.net.ProgressSource.updateProgress(Unknown Source)
at sun.net.www.MeteredStream.justRead(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at sun.plugin.net.protocol.http.HttpUtils.cleanupConnection(Unknown Source)
at sun.plugin.cache.CachedJarLoader.decompress(Unknown Source)
at sun.plugin.cache.CachedJarLoader.access$500(Unknown Source)
at sun.plugin.cache.CachedJarLoader$5.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.cache.CachedJarLoader.download(Unknown Source)
at sun.plugin.cache.CachedJarLoader.load(Unknown Source)
at sun.plugin.cache.JarCache.get(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
at sun.misc.URLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.getResource(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
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)
Exception in thread "Thread-6" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPanel.paint(Unknown Source)
at sun.plugin.util.GrayBoxPanel.setImage(Unknown Source)
at sun.plugin.util.GrayBoxPanel.setError(Unknown Source)
at sun.plugin.util.GrayBoxPainter.getGrayBoxPanel(Unknown Source)
at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPanel.paint(Unknown Source)
at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-
classname java.lang.NullPointerException
at sun.plugin.util.GrayBoxPanel.paint(Unknown Source)
at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-4" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPanel.paint(Unknown Source)
at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
at sun.plugin.util.GrayBoxPainter.access$000(Unknown Source)
at sun.plugin.util.GrayBoxPainter$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Now plz can you tell me what is going wrong??

Thanx.
- Neha
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Neha,
can you post the code and the html ,so that can check it out
Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Rajendar,

I am so sorry but there are so many packages & many number of files.... so wont be able to provide u the code... & also confidential code....

so am so sorry....
well i'll try & let you knw abt it again....

Thanx.

Regards,
- Neha
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Its ok neha,
i will check out for the solution and will write back.
Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Hi Rajendar,

Thanx a lot for ur support. Even I'll try to find out the solution & if it works properly i'll let u knw..

Thanx..

Regards,
- Neha.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in loading applet in IE - " 'CODE' Parameter" for jre1.5