ScripteEngineManagerFactory.refreshScriptEngineManager may throw exceptions
---------------------------------------------------------------------------
Key: SLING-1544
URL: https://issues.apache.org/jira/browse/SLING-1544
Project: Sling
Issue Type: Bug
Components: Scripting
Affects Versions: Scripting Core 2.0.12
Reporter: Felix Meschberger
Assignee: Felix Meschberger
Fix For: Scripting Core 2.0.12
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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.