Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.NamespaceHandlerSetImpl class deals with namespace handlers for single BP container.
During creation, it takes all already registered handlers from global NS registry.
After creation it is added to sets field in the registry to get notified about newly registered NS handlers.
But when NS handler is registered between the above two steps, BP stays in GRACE_PERIOD state infinitely, because this "case" in BP container impl:
case WaitForNamespaceHandlers: { List<String> missing = new ArrayList<String>(); List<URI> missingURIs = new ArrayList<URI>(); for (URI ns : namespaces) { if (handlerSet.getNamespaceHandler(ns) == null) {
won't ever get namespace handler, because it looks in the handler set obtained when NamespaceHandlerRegistryImpl.NamespaceHandlerSetImpl was constructed.
This:
10:51 $ git diff diff --git a/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java b/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java index 7688924..d53ea5c 100644 --- a/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java +++ b/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java @@ -535,6 +535,9 @@ public class NamespaceHandlerRegistryImpl implements NamespaceHandlerRegistry, S } public NamespaceHandler getNamespaceHandler(URI namespace) { + if (!handlers.containsKey(namespace)) { + findCompatibleNamespaceHandler(namespace); + } return handlers.get(namespace); }
fixes the problem
Attachments
Issue Links
- is related to
-
CAMEL-7469 Make CamelBlueprintTestSupport tests more predictable
- Resolved
-
CAMEL-8948 CamelBlueprintTestSupport tests have issues with namespace handlers
- Resolved