{"record":{"id":"43a773434b7f3858","repo":"apache/hadoop","slug":"resources-in-jars-can-t-be-zipped-resource-s-is","errorCode":null,"errorMessage":"Resources in JARs can't be zipped; resource %s is ARCHIVE and src is: %s","messagePattern":"Resources in JARs can't be zipped; resource (.+?) is ARCHIVE and src is: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/Client.java","lineNumber":774,"sourceCode":"    String srcScheme = srcSchemes.iterator().next();\n\n    String srcPathString = \"[\" + Joiner.on(\",\").join(srcPaths) + \"]\";\n\n    if (srcScheme == null\n        || srcScheme.equals(FileSystem.getLocal(getConf()).getScheme())\n        || srcScheme.equals(\"jar\")) {\n      // Need to upload this resource to remote storage\n      List<File> srcFiles = srcURIs.stream().map(URI::getSchemeSpecificPart)\n          .map(File::new).collect(Collectors.toList());\n      Path dstPathBase = getRemoteStoragePath(getConf(), appId);\n      boolean shouldArchive = srcFiles.size() > 1\n          || srcFiles.get(0).isDirectory()\n          || (resource.getType() == LocalResourceType.ARCHIVE\n              && Arrays.stream(ARCHIVE_FILE_TYPES).noneMatch(\n                  suffix -> srcFiles.get(0).getName().endsWith(suffix)));\n      if (shouldArchive) {\n        if (\"jar\".equals(srcScheme)) {\n          throw new IllegalArgumentException(String.format(\"Resources in JARs \"\n                  + \"can't be zipped; resource %s is ARCHIVE and src is: %s\",\n              resource.getResourcePath(), srcPathString));\n        } else if (resource.getType() != LocalResourceType.ARCHIVE) {\n          throw new IllegalArgumentException(\n              String.format(\"Resource type is %s but srcPaths were: %s\",\n                  resource.getType(), srcPathString));\n        }\n        dstPath = new Path(dstPathBase, resource.getResourcePath())\n            .suffix(\".zip\");\n      } else {\n        dstPath = new Path(dstPathBase, srcFiles.get(0).getName());\n      }\n      FileSystem remoteFS = dstPath.getFileSystem(getConf());\n      LOG.info(\"Uploading resource \" + resource + \" from \" + srcPathString\n          + \" to \" + dstPath);\n      try (OutputStream outputStream = remoteFS.create(dstPath, true)) {\n        if (\"jar\".equals(srcScheme)) {\n          try (InputStream inputStream = new URL(srcPaths[0]).openStream()) {","sourceCodeStart":756,"sourceCodeEnd":792,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/Client.java#L756-L792","documentation":"Error \"Resources in JARs can't be zipped; resource %s is ARCHIVE and src is: %s\" thrown in apache/hadoop.","triggerScenarios":"The dynamometer Client is asked to create an ARCHIVE out of a resource that is itself inside a JAR (non-hdfs remote scheme), which cannot be zipped; only local files or single remote files can be archived.","commonSituations":"See trigger scenarios.","solutions":["Do not archive a resource of type ARCHIVE; pass the JAR directly as a FILE/LIBJAR resource instead of zipping it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}