apache/druid · error · RE

The extension [ ] has multiple jars [ ] [ ] with…

Error message

The extension [%s] has multiple jars [%s] [%s] with dependencies in them. Each jar should be in a separate extension directory.

What it means

An extension directory may contain at most one jar carrying the druid-extension-dependencies.json descriptor. getDruidExtensionDependencies() scans jars in the extension directory and throws this RE if two different jars in the same extension both contain that entry, since it cannot decide which dependency manifest is authoritative.

Solutions

  1. Remove the stale/duplicate jar so only one jar in the directory contains druid-extension-dependencies.json
  2. Split the jars into separate extension directories, one per extension
  3. Rebuild the extension so the dependency descriptor is only packaged in the primary jar
  4. List the jar contents with `unzip -l *.jar | grep druid-extension-dependencies` to find the offending jars

Example fix

// before
extensions/myext/myext-1.0.0.jar myext-1.1.0.jar  # both contain the descriptor
// after
extensions/myext/myext-1.1.0.jar
Defensive patterns

Strategy: validation

Validate before calling

Set<String> descriptorJars = new HashSet<>();
for (File jar : new File(extDir).listFiles((d,n)->n.endsWith(".jar"))) {
  try (JarFile jf = new JarFile(jar)) {
    if (jf.getJarEntry("druid-extension-dependencies.json") != null) {
      if (!descriptorJars.add(jar.getName())) throw new IllegalStateException("Duplicate descriptor in " + extDir);
    }
  }
}

Try / catch

try { loadExtension(extDir); } catch (RE e) {
  if (e.getMessage().contains("multiple jars")) { dedupeExtensionJars(extDir); }
  throw e;
}

Prevention

When it happens

Trigger: An extension directory contains 2+ jars that each bundle druid-extension-dependencies.json (usually from building/packaging the extension wrong or dropping multiple versions of the same jar into one extension folder).

Common situations: Copying an old and new version of an extension jar into the same directory; shading the dependency descriptor into multiple module jars of one extension; careless `cp *.jar extensions/myext/` after an upgrade.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/b5d01823a0708813. Report an issue: GitHub.

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/guice/ExtensionsLoader.java:389

    }
  }

  private Optional<DruidExtensionDependencies> getDruidExtensionDependencies(File extension)
  {
    final Collection<File> jars = FileUtils.listFiles(extension, new String[]{"jar"}, false);
    DruidExtensionDependencies druidExtensionDependencies = null;
    String druidExtensionDependenciesJarName = null;
    for (File extensionFile : jars) {
      try (JarFile jarFile = new JarFile(extensionFile.getPath())) {
        Enumeration<JarEntry> entries = jarFile.entries();

        while (entries.hasMoreElements()) {
          JarEntry entry = entries.nextElement();
          String entryName = entry.getName();
          if (DRUID_EXTENSION_DEPENDENCIES_JSON.equals(entryName)) {
            log.debug("Found extension dependency entry in jar [%s]", extensionFile.getPath());
            if (druidExtensionDependenciesJarName != null) {
              throw new RE(
                  StringUtils.format(
                      "The extension [%s] has multiple jars [%s] [%s] with dependencies in them. Each jar should be in a separate extension directory.",
                      extension.getName(),
                      druidExtensionDependenciesJarName,
                      jarFile.getName()
                  )
              );
            }
            druidExtensionDependencies = objectMapper.readValue(
                jarFile.getInputStream(entry),
                DruidExtensionDependencies.class
            );
            druidExtensionDependenciesJarName = jarFile.getName();
          }
        }
      }
      catch (IOException e) {
        throw new RE(e, "Failed to get dependencies for extension [%s]", extension);

View on GitHub (pinned to 9b90983fd2)