Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1544

ScripteEngineManagerFactory.refreshScriptEngineManager may throw exceptions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Scripting Core 2.0.14
    • Scripting Core 2.0.14
    • Scripting
    • None

    Description

      The ScripteEngineManagerFactory.refreshScriptEngineManager method throw the following exceptions on startup of shutdown:

      NullPointerException
      while trying to register the ScriptEngineManager service because the BundleContext field is null

      IllegalStateException
      while trying to unregister the ScriptEngineManager service because a previous unregistration succeeded but re-registration failed due to the NullPointerException due to bundle context being null. As a result the the ServiceRegistration field is still set but invalid actually.

      Fixes:

      • Ensure registration is only tried if bundle context is not null
      • Clear the service registration field after unregistering the service

      Plus, the refreshScriptEngineManager method must make sure to be thread-safe.

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: