0 Replies Latest reply: Feb 14, 2013 1:08 PM by 991187 RSS

    Strange re init of static variable in applet

    991187
      I have a shared class the manages caching of information for my applets. This class uses the singleton pattern and is initalized statically at startup of the applet.

      P.S. I am using JRE version:
      Java Plug-in 10.9.2.05
      Using JRE version 1.7.0_09-b05 Java HotSpot(TM) Client VM

      The problem:

      I navigate to the applet page, and get the following class loader loading my applet:
      sun.plugin2.applet.Applet2ClassLoader@8aedb7

      Then I navigate away to another page and come back to my applet page. The static cache is still there and the following is the classloader used:
      sun.plugin2.applet.Applet2ClassLoader@8aedb7

      Now i navigate away from the applet page and return a second time, and suddenly get this class loader (and the static is re initialized obviously):
      sun.plugin2.applet.Applet2ClassLoader@8aedb7

      The url's are the same etc.. so I am stumped as to why i 'randomly' get a different class loader and ultimately trashes my static singleton cache.