Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4266

resource reloading does not work in IBM JVM

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.3.16
    • 2.3.20
    • Core Actions
    • None
    • WAS 8.5 with IBM JVM 6

    • Patch

    Description

      When resources reloading is enabled, LocalizedTextUtil uses reflection to clear a private static map of the ResourceBundle class. The member name of that map is "cacheList".

      The IBM JVM has a different impl of ResourceBundle which does not have the "cacheList" member. That causes a lot of NoSuchFieldExceptions in log and resource reloading does not work.

      To fix it the patch catches NoSuchFieldException and uses clearMap() to clear the cache of that IBM ResourceBundle (which is just called "cache").

      Notes:

      • Javadoc indicates that that IBM code is based on the Apache Harmony project
      • The type of that cache member is:
        WeakHashMap<ClassLoader, Hashtable<String, ResourceBundleSoftRef>>
        So one could argue that the patch clears too much, but IMHO that is OK as it is intended for development mode anyway.

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            cn42 Christoph Nenning
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: