private void loadDescriptor(final URL descriptorURL) {
    // simple path for log messages
    final String descriptorLocation = descriptorURL.getPath();

    InputStream stream = null;
    try {
      stream = descriptorURL.openStream();

      BufferedReader in = new BufferedReader(new InputStreamReader(stream));
      XmlHandler handler = new XmlHandler(m_context.getBundle(), this);
      KXml2SAXParser parser;

      parser = new KXml2SAXParser(in);

      parser.parseXML(handler);

      // 112.4.2 Component descriptors may contain a single, root component element
      // or one or more component elements embedded in a larger document
      Iterator i = handler.getComponentMetadataList().iterator();
      while (i.hasNext()) {
        ComponentMetadata metadata = (ComponentMetadata) i.next();
        try {
          // check and reserve the component name
          m_componentRegistry.checkComponentName(metadata.getName());

          // validate the component metadata
          metadata.validate(this);

          // Request creation of the component manager
          ComponentHolder holder = m_componentRegistry.createComponentHolder(this, metadata);

          // register the component after validation
          m_componentRegistry.registerComponentHolder(metadata.getName(), holder);
          m_managers.add(holder);

          // enable the component
          if (metadata.isEnabled()) {
            holder.enableComponents();
          }
        } catch (Throwable t) {
          // There is a problem with this particular component, we'll log the error
          // and proceed to the next one
          log(LogService.LOG_ERROR, "Cannot register Component", metadata, t);

          // make sure the name is not reserved any more
          m_componentRegistry.unregisterComponentHolder(metadata.getName());
        }
      }
    } catch (IOException ex) {
      // 112.4.1 If an XML document specified by the header cannot be located in the bundle and its
      // attached
      // fragments, SCR must log an error message with the Log Service, if present, and continue.

      log(
          LogService.LOG_ERROR,
          "Problem reading descriptor entry ''{0}''",
          new Object[] {descriptorLocation},
          null,
          ex);
    } catch (Exception ex) {
      log(
          LogService.LOG_ERROR,
          "General problem with descriptor entry ''{0}''",
          new Object[] {descriptorLocation},
          null,
          ex);
    } finally {
      if (stream != null) {
        try {
          stream.close();
        } catch (IOException ignore) {
        }
      }
    }
  }