aspose file tools*
The moose likes Applets and the fly likes Weird InstantiationException problem in IE (MSJVM) - due to caching? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Weird InstantiationException problem in IE (MSJVM) - due to caching?" Watch "Weird InstantiationException problem in IE (MSJVM) - due to caching?" New topic
Author

Weird InstantiationException problem in IE (MSJVM) - due to caching?

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
The name of my applet class was MyProjectApplet.class, packaged in a jar (unsigned) called MyProject.jar. My html code was:

<applet code="myPackage.MyProjectApplet.class" archive="MyProject.jar" width="180" height="45">
</applet>

It all worked fine, then recently I needed to make a few changes to the MyProjectApplet code but, when testing it out, I noticed that these changes were not being picked up in IE - IE was still using the old code. (The new code ran fine in Firefox.)

Assuming the problem was down to IE caching the old class files, I cleared the IE cache (Tools -> Options -> Delete Files) - but the problem persisted...

So, to overcome the caching, I decided to rename my class and jar - to MyProjectApplet_New.class and MyProject_New.jar, changing my html code to:

<applet code="myPackage.MyProjectApplet_New.class" archive="MyProject_New.jar" width="180" height="45">
</applet>

And now I get the following message when IE tries to load my applet:

java.lang.InstantiationException: myPackage/MyProjectApplet_New
at com/ms/applet/BrowserAppletFrame.newInstance
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run

And the strangest thing is that if I now use this html:

<applet code="myPackage.MyProjectApplet.class" archive="MyProject_New.jar" width="180" height="45">
</applet>

...that is, specifying the new jar but with the old applet class name (that doesn't even exist in the new jar), then the applet runs! (But it runs the old code, not the new code...)

Does anyone know what is going on? Have I missed something really obvious?

Thanks,
James
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
At long long long long last, I've found the cause of the problem!...

For some reason, all my classes were being stored in my C:\WINDOWS\Java\lib directory!...

I don't know why, but I've deleted them and things are back up and running.

Happy days!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Weird InstantiationException problem in IE (MSJVM) - due to caching?