Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When initializing a component, then Resource_ImplBase sets the Session of the ConfigurationManager of the current UimaContext using the Session of the current UimaContext:
{org.apache.uima.resource.Resource_ImplBase.initialize(ResourceSpecifier, Map<String, Object>)}mUimaContextAdmin.getConfigurationManager() .setSession(mUimaContextAdmin.getSession());
However, this can set the wrong session on the
{ConfigurationManager}. In a hierarchy of {UimaContexts}, there is only one {ConfigurationManager}associated with the
{RootUimaContext_impl}. The {ChildUimaContext_impl} delegate to their respective root in their {getConfigurationManager()} methods.So far so good.
But the {Session} of returned by {ChildUimaContext_impl.getSession()} is a scoped {SessionNamespaceView_impl} instance which limits the view to the parameters applicable to the child context. The problematic lines above cause this scoped session view to be injected into the {ConfigurationManager} of the {RootUimaContext_impl}
which can cause configuration parameters at the root level to become inaccessible.
At least, the code would need to be changed to
mUimaContextAdmin.getConfigurationManager() .setSession(mUimaContextAdmin.getRootContext().getSession());
but instead of doing that, the code could probably also be change to inject the session when creating the
{RootUimaContext_impl}in the first place.