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

registration (or unregistration) of a ScriptEngineFactory doesn't cause the ScriptEngineManager service to be re-registered

    XMLWordPrintableJSON

Details

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

    Description

      ScriptEngineManagerFactory.refreshScriptEngineManager() handles the registration of an OSGi service of the ScriptEngineManager. This is used, amongst other places, by SlingScriptAdapterFactory.

      However, refreshScriptEngineManager() is only called from activate() and getScriptEngineManager() (and in the latter case, only if the scriptEngineManager is null). Although bindScriptEngineManager() (and unbind) null out scriptEngineManager, they do not call refreshScriptEngineManager(). As a result, new ScriptEngineFactory services are not effective with this call sequence:

      1) activate()
      2) bindScriptEngineManager()
      3) try adapting a script to a javax.servlet.Servlet

      This can be worked around (albeit poorly IMHO) by going to the Configuration Status page in the web console because this causes getScriptEngineManager() to be called when scriptEngineManager is null, thus causing refreshScriptEngineManager() to be called.

      Attachments

        Activity

          People

            justinedelson Justin Edelson
            justinedelson Justin Edelson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: