{"record":{"id":"08d8071ddb2ab90f","repo":"apache/druid","slug":"problem-instantiating-object-at-prefix-s-s-s","errorCode":null,"errorMessage":"Problem instantiating object at prefix[%s]: %s: %s.","messagePattern":"Problem instantiating object at prefix\\[(.+?)\\]: (.+?): (.+?)\\.","errorType":"validation","errorClass":"ProvisionException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/guice/JsonConfigurator.java","lineNumber":151,"sourceCode":"        // using the JsonCreator annotated factory method or no-arg constructor.\n        // We know it exists because verifyClazzIsConfigurable checks for it.\n        Optional<Method> factoryMethod = findJsonCreatorFactoryMethod(defaultClass);\n        if (factoryMethod.isPresent()) {\n          config = (T) factoryMethod.get().invoke(null);\n        } else {\n          config = defaultClass.getConstructor().newInstance();\n        }\n      } else {\n        config = jsonMapper.convertValue(jsonMap, clazz);\n      }\n    }\n    catch (IllegalArgumentException e) {\n      throw new ProvisionException(\n          StringUtils.format(\"Problem parsing object at prefix[%s]: %s.\", propertyPrefix, e.getMessage()), e\n      );\n    }\n    catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {\n      throw new ProvisionException(\n          StringUtils.format(\n              \"Problem instantiating object at prefix[%s]: %s: %s.\",\n              propertyPrefix,\n              e.getClass().getSimpleName(),\n              e.getMessage()\n          ),\n          e\n      );\n    }\n\n    final Set<ConstraintViolation<T>> violations = validator.validate(config);\n    if (!violations.isEmpty()) {\n      List<String> messages = new ArrayList<>();\n\n      for (ConstraintViolation<T> violation : violations) {\n        StringBuilder path = new StringBuilder();\n        try {\n          Class<?> beanClazz = violation.getRootBeanClass();","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/guice/JsonConfigurator.java#L133-L169","documentation":"JsonConfigurator.configurate() reflectively constructs the configured object (via a JSON-annotated constructor). If instantiation/invocation throws NoSuchMethodException, InstantiationException, IllegalAccessException, or InvocationTargetException, it is wrapped in this ProvisionException indicating the object at the given config prefix could not be constructed.","triggerScenarios":"The configured class has no matching @JsonCreator constructor for the map, is abstract/interface, its constructor throws, or constructor access is restricted — all during Guice provider creation for a config-backed object.","commonSituations":"Configuring druid.<x>.type pointing to a class whose constructor throws due to invalid internal setup; pointing a config at an interface/abstract type; extension class present in loadList issues so its creator isn't visible; refactored class removing the old creator signature.","solutions":["Look at the wrapped cause (InvocationTargetException target) for the real constructor failure and fix that input","Verify the <x>.type value names a concrete, instantiable registered class","Ensure the extension providing the class is loaded and on the classpath","Check class constructor requirements (e.g. required args/annotations) after upgrades"],"exampleFix":"// before\n-Ddruid.storage.type=org.apache.druid.storage.custom.MyStore  // abstract class\n// after\n-Ddruid.storage.type=org.apache.druid.storage.custom.MyStoreImpl","handlingStrategy":"try-catch","validationCode":"Class<?> clazz = jsonMapper.convertValue(map, Object.class).getClass();\n// verify the configured type resolves to a concrete instantiable class\nAssert.assertFalse(Modifier.isAbstract(clazz.getModifiers()));","typeGuard":null,"tryCatchPattern":"try { startDruid(); } catch (ProvisionException e) {\n  if (e.getMessage().startsWith(\"Problem instantiating object at prefix\")) {\n    log.error(\"Constructor failed for {}: {}\", extractPrefix(e.getMessage()), e.getCause(), e);\n  }\n  throw e;\n}","preventionTips":["Ensure configured <x>.type values refer to concrete registered implementations","Inspect the cause chain — InvocationTargetException hides the real constructor error","Keep extensions providing the class in the loadList and classpath after upgrades"],"tags":["configuration","reflection","guice"],"backgroundTag":"invalid-constructor-argument","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}