Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-18337

nuxeo-runtime bundles must not be registered twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 5.1.4
    • Fix Version/s: None
    • Component/s: Runtime

      Description

      A workaround has been set to avoid spurious "Duplicate component name" errors:

      commit 356eeedd10ea0e153ca7b6b938a68e934c89d66a
      Author: Florent Guillaume <fg@nuxeo.com>
      Date:   Sat Apr 12 23:53:27 2008 +0200
      
          hide the fact that nuxeo-runtime bundles are registered twice
      
      @@ -143,6 +143,12 @@ public class ComponentManagerImpl implements ComponentManager {
           public final void _register(RegistrationInfoImpl ri) {
               ComponentName name = ri.getName();
               if (isRegistered(name)) {
      +            if (name.getName().startsWith("org.nuxeo.runtime.")) {
      +                // XXX we hide the fact that nuxeo-runtime bundles are
      +                // registered twice
      +                // TODO fix the root cause and remove this
      +                return;
      +            }
                   String msg = "Duplicate component name: '" + name + "'";
                   log.error(msg);
                   Framework.getRuntime().getWarnings().add(msg);
      

      This double registration appears on blacklisted nuxeo-runtime components: WARN [localhost-startStop-1] [org.nuxeo.runtime.model.impl.ComponentManagerImpl] Component org.nuxeo.runtime.trackers.files.threadstracking.config was blacklisted. Ignoring. is logged twice.

      The root cause is still present:

      • update the TODO with the current issue reference
      • add a debug log
      • maybe accept only two registrations: the current code hides all duplicates on org.nuxeo.runtime.* components
      • blacklist and aliases are not properly managed regarding that issue
        ComponentName name = ri.getName();
        if (blacklist.contains(name.getName())) {
            log.warn("Component " + name.getName() + " was blacklisted. Ignoring.");
            return;
        }
        if (reg.contains(name)) {
            if (name.getName().startsWith("org.nuxeo.runtime.")) {
                // XXX we hide the fact that nuxeo-runtime bundles are
                // registered twice
                // TODO fix the root cause and remove this
                return;
            }
            handleError("Duplicate component name: " + name, null);
            return;
        }
        for (ComponentName n : ri.getAliases()) {
            if (reg.contains(n)) {
                handleError("Duplicate component name: " + n + " (alias for " + name + ")", null);
                return;
            }
        }

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: