{"record":{"id":"e9974d2ac147d3a7","repo":"apache/hadoop","slug":"invalid-codepath-classname-codepath","errorCode":null,"errorMessage":"invalid codePath: className={} codePath={}","messagePattern":"invalid codePath: className=(.+?) codePath=(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamUtil.java","lineNumber":98,"sourceCode":"    String codePath;\n    if (classUrl != null) {\n      boolean inJar = classUrl.getProtocol().equals(\"jar\");\n      codePath = classUrl.toString();\n      if (codePath.startsWith(\"jar:\")) {\n        codePath = codePath.substring(\"jar:\".length());\n      }\n      if (codePath.startsWith(\"file:\")) { // can have both\n        codePath = codePath.substring(\"file:\".length());\n      }\n      if (inJar) {\n        // A jar spec: remove class suffix in /path/my.jar!/package/Class\n        int bang = codePath.lastIndexOf('!');\n        codePath = codePath.substring(0, bang);\n      } else {\n        // A class spec: remove the /my/package/Class.class portion\n        int pos = codePath.lastIndexOf(relPath);\n        if (pos == -1) {\n          throw new IllegalArgumentException(\"invalid codePath: className=\" + className\n                                             + \" codePath=\" + codePath);\n        }\n        codePath = codePath.substring(0, pos);\n      }\n    } else {\n      codePath = null;\n    }\n    return codePath;\n  }\n\n  static String qualifyHost(String url) {\n    try {\n      return qualifyHost(new URL(url)).toString();\n    } catch (IOException io) {\n      return url;\n    }\n  }\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamUtil.java#L80-L116","documentation":"Error \"invalid codePath: className={} codePath={}\" thrown in apache/hadoop.","triggerScenarios":"StreamUtil resolves a class's code source path that is null or otherwise invalid, e.g. the class was loaded by the bootstrap classloader.","commonSituations":"See trigger scenarios.","solutions":["Ensure the class is packaged in the job jar and the code path (jar/classpath entry) is valid and readable."],"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"}