Force UntrustedXML to be initialized from activator 98/77298/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 24 Oct 2018 21:01:25 +0000 (23:01 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 26 Oct 2018 10:02:11 +0000 (10:02 +0000)
Touching UntrustedXML during bundle activator should cause it to
bind to the JRE XML provider rather than discovering other members
via a TCCL.

Change-Id: I9c6625be7873ed96d5e292a3165e7f319ac68b56
JIRA: CONTROLLER-1867
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 978ef9d2ccbbaf4e54aa43109f7af21603226516)

opendaylight/blueprint/src/main/java/org/opendaylight/controller/blueprint/BlueprintBundleTracker.java

index d3db3277425bcd0d5c22dca72352e9a055baa904..3f821ba731ac44e51dd380bb59fe0687b88f320d 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.aries.blueprint.services.BlueprintExtenderService;
 import org.apache.aries.quiesce.participant.QuiesceParticipant;
 import org.apache.aries.util.AriesFrameworkUtil;
 import org.opendaylight.controller.blueprint.ext.OpendaylightNamespaceHandler;
+import org.opendaylight.yangtools.util.xml.UntrustedXML;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
@@ -73,6 +74,9 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
     public void start(final BundleContext context) {
         LOG.info("Starting {}", getClass().getSimpleName());
 
+        // CONTROLLER-1867: force UntrustedXML initialization, so that it uses our TCCL to initialize
+        UntrustedXML.newDocumentBuilder();
+
         restartService = new BlueprintContainerRestartServiceImpl();
 
         bundleContext = context;
@@ -231,7 +235,7 @@ public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCus
      * @param event the event to handle
      */
     @Override
-    public void blueprintEvent(BlueprintEvent event) {
+    public void blueprintEvent(final BlueprintEvent event) {
         if (event.getType() == BlueprintEvent.CREATED) {
             LOG.info("Blueprint container for bundle {} was successfully created", event.getBundle());
             return;