Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4418820

logging APIs: Logger can't find resource bundles from app classloader

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • core-libs
    • None
    • beta2
    • x86
    • windows_nt
    • Verified


      There is a problem with the way that the Logger.getLogger
      methods find ResourceBundles.

      Broadly, some application code is running in
      classloader A. If the application code calls
      ResourceBundle.getBundle, then there is some magic
      code in ResourceBundle that determines that the
      caller is in classloader A and ResourceBundle then
      uses ClassLoader A to find the resource bundle.

      However, if the app code calls into the Logging
      APIs, and the Logging APIs then call
      ResourceBundle.getBundle, then the ResourceBundle
      code will see that the call is coming from code
      using the system classloader, and will use the
      system classloader (rather than classloader A)
      to find the bundle.


      For container based apps, the app running in the container
      will typically have its resources in its own classloader
      and not in the system classloader.

      So this is definitely a problem.

      graham.hamilton@Eng 2001-02-25

            ghamiltosunw Graham Hamilton (Inactive)
            ghamiltosunw Graham Hamilton (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: