Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Scripting Core 2.0.14
-
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.