{"record":{"id":"f20fb0ca15711f26","repo":"apache/druid","slug":"thrift-class-s-not-found","errorCode":null,"errorMessage":"Thrift class [%s] not found","messagePattern":"Thrift class \\[(.+?)\\] not found","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftReader.java","lineNumber":123,"sourceCode":"\n  private Map<String, Object> toFlattenedMap(byte[] bytes) throws ParseException\n  {\n    try {\n      final Class<TBase> clazz = getThriftClass();\n      final TBase tbase = clazz.newInstance();\n      ThriftDeserialization.detectAndDeserialize(bytes, tbase);\n      final String json = ThriftDeserialization.SERIALIZER_SIMPLE_JSON.get().toString(tbase);\n      final JsonNode node = OBJECT_MAPPER.readTree(json);\n      return recordFlattener.flatten(node);\n    }\n    catch (TException | IOException e) {\n      throw new ParseException(null, e, \"Failed to deserialize Thrift data\");\n    }\n    catch (InstantiationException | IllegalAccessException e) {\n      throw new ParseException(null, e, \"Failed to instantiate Thrift class [%s]\", thriftClassName);\n    }\n    catch (ClassNotFoundException e) {\n      throw new ParseException(null, e, \"Thrift class [%s] not found\", thriftClassName);\n    }\n  }\n\n  @SuppressWarnings({\"unchecked\", \"ReturnValueIgnored\"})\n  private Class<TBase> getThriftClass() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException\n  {\n    if (thriftClass == null) {\n      final Class<TBase> clazz;\n      if (jarPath != null) {\n        File jar = new File(jarPath);\n        URLClassLoader child = new URLClassLoader(\n            new URL[]{jar.toURI().toURL()},\n            this.getClass().getClassLoader()\n        );\n        clazz = (Class<TBase>) Class.forName(thriftClassName, true, child);\n      } else {\n        clazz = (Class<TBase>) Class.forName(thriftClassName);\n      }","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftReader.java#L105-L141","documentation":"toFlattenedMap() resolves the Thrift class via getThriftClass() and instantiates it inside the try block; this branch converts ClassNotFoundException (and related linkage errors from instantiation) into a ParseException. It fires when the configured Thrift class name cannot be found on the Druid process classpath, i.e. a configuration/deployment problem rather than bad input data.","triggerScenarios":"Thrown at extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftReader.java:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the JAR containing the generated Thrift classes to the classpath or load it as a Druid extension","Correct the thriftClass name in the reader configuration (package and class must match exactly)","Restart affected Druid processes so they pick up the newly deployed extension jars"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}