• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
How do they get the deer to cross at the signs? Or to read this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic