{"record":{"id":"7f19e711692cb993","repo":"provectus/kafka-ui","slug":"no-archive-files-were-found","errorCode":null,"errorMessage":"No archive files were found","messagePattern":"No archive files were found","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/CustomSerdeLoader.java","lineNumber":86,"sourceCode":"      List<URL> archiveFiles = new ArrayList<>();\n      try (var files = Files.walk(location)) {\n        var paths = files.filter(CustomSerdeLoader::isArchive).collect(Collectors.toList());\n        for (Path path : paths) {\n          archiveFiles.add(path.toUri().toURL());\n        }\n      }\n      return archiveFiles;\n    }\n    return List.of();\n  }\n\n  private ClassLoader createClassloader(Path location) {\n    if (!Files.exists(location)) {\n      throw new IllegalStateException(\"Location does not exist\");\n    }\n    var archives = findArchiveFiles(location);\n    if (archives.isEmpty()) {\n      throw new IllegalStateException(\"No archive files were found\");\n    }\n    // we assume that location's content does not change during serdes creation\n    // so, we can reuse already created classloaders\n    return classloaders.computeIfAbsent(location, l ->\n        AccessController.doPrivileged(\n            (PrivilegedAction<URLClassLoader>) () ->\n                new ChildFirstClassloader(\n                    archives.toArray(URL[]::new),\n                    CustomSerdeLoader.class.getClassLoader())));\n  }\n\n  //---------------------------------------------------------------------------------\n\n  // This Classloader first tries to load classes by itself. If class not fount\n  // search is propagated to parent (this is opposite to how usual classloaders work)\n  private static class ChildFirstClassloader extends URLClassLoader {\n\n    private static final String JAVA_PACKAGE_PREFIX = \"java.\";","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/CustomSerdeLoader.java#L68-L104","documentation":"CustomSerdeLoader.createClassloader scans the configured serde location for archive files (jar/zip). If the path exists but contains no archives, it throws IllegalStateException('No archive files were found') because an empty directory cannot yield any serde classes to load.","triggerScenarios":"filePath points to an existing but empty directory, or a directory containing only non-archive files (txt, class files unpacked, .so, etc.).","commonSituations":"Volume mounted but jar not copied in; user points filePath at a directory of extracted class files instead of the jar; archive has an unsupported extension; download/CI step failed silently leaving an empty dir.","solutions":["Place the serde jar (or zip) into the configured directory","Point filePath directly at the jar file or a directory that contains it","Check archive extension is one the loader recognizes (jar/zip)","Re-run the build/copy step that was supposed to populate the directory"],"exampleFix":"// before\nfilePath: /opt/serdes/   # empty directory\n// after\nfilePath: /opt/serdes/my-serde-1.0.jar","handlingStrategy":"validation","validationCode":"Path loc = Path.of(cfg.getFilePath());\ntry (var s = Files.list(loc)) {\n  if (s.noneMatch(p -> p.toString().endsWith(\".jar\") || p.toString().endsWith(\".zip\")))\n    throw new IllegalStateException(\"No archives in \" + loc);\n}","typeGuard":null,"tryCatchPattern":"try {\n  classloader = CustomSerdeLoader.serdeClassloader(location);\n} catch (IllegalStateException e) {\n  log.error(\"No serde archives at {}: {}\", location, e.getMessage());\n  throw e;\n}","preventionTips":["Verify the directory contains the jar before pointing config at it","Point filePath directly at the jar when possible","Check CI/copy steps actually populated the volume"],"tags":["serde","classpath","filesystem","empty-directory"],"backgroundTag":"file-not-found","analyzedSha":"83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7","analyzedAt":"2026-09-08T04:35:39.002Z","contentChangedAt":"2026-09-08T04:35:39.002Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}