{"record":{"id":"19754d38c391ad60","repo":"hibernate/hibernate-orm","slug":"the-provided-setting-value-is-not-supporte","errorCode":null,"errorMessage":"The provided {} setting value [{}] is not supported","messagePattern":"The provided (.+?) setting value \\[(.+?)\\] is not supported","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java","lineNumber":1725,"sourceCode":"\t\t\tinstanceClass = (Class<? extends T>) settingValue;\n\t\t}\n\t\telse if ( settingValue instanceof String className ) {\n\t\t\tif ( standardServiceRegistry != null ) {\n\t\t\t\tinstanceClass =\n\t\t\t\t\t\tstandardServiceRegistry.requireService( ClassLoaderService.class )\n\t\t\t\t\t\t\t\t.classForName( className );\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttry {\n\t\t\t\t\tinstanceClass = (Class<? extends T>) Class.forName( className );\n\t\t\t\t}\n\t\t\t\tcatch (ClassNotFoundException e) {\n\t\t\t\t\tthrow new IllegalArgumentException( \"Can't load class: \" + className, e );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException( \"The provided \" + settingName\n\t\t\t\t\t+ \" setting value [\" + settingValue + \"] is not supported\" );\n\t\t}\n\n\t\tif ( instanceClass != null ) {\n\t\t\ttry {\n\t\t\t\treturn instanceClass.newInstance();\n\t\t\t}\n\t\t\tcatch (InstantiationException | IllegalAccessException e) {\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"The \" + clazz.getSimpleName() +\" class [\" + instanceClass + \"] could not be instantiated\",\n\t\t\t\t\t\te\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}","sourceCodeStart":1707,"sourceCodeEnd":1743,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java#L1707-L1743","documentation":"Thrown by EntityManagerFactoryBuilderImpl.loadSettingInstance() as an IllegalArgumentException when the value supplied for a class-typed setting is neither an instance of the expected type, nor a Class object, nor a String. loadSettingInstance only supports those three forms, so any other Java object (Integer, Boolean, enum, custom type) is rejected at boot with the setting name and offending value in the message.","triggerScenarios":"Putting a non-String/Class/instance object into configurationValues for a setting handled by loadSettingInstance - e.g. an enum constant, a boxed primitive, or a config-binding object from a typed config source (Spring's Environment adapters, MicroProfile Config converters).","commonSituations":"Migration from String-based properties to typed configuration maps where a converter already produced a non-String object; copy-pasting a value of the wrong type into a bootstrap config map; frameworks injecting typed values where Hibernate expects instance/Class/FQCN-string.","solutions":["Change the value to the fully-qualified class name string of your implementation.","Or pass the Class object itself (MyInterceptor.class) in programmatic configuration.","Or pass a pre-constructed instance of the implementation.","Audit the config source that produced the value (message shows it) and fix its type conversion."],"exampleFix":"// before\nMap<String,Object> settings = new HashMap<>();\nsettings.put(\"hibernate.session_factory.observer\", 42); // unsupported type\n\n// after\nsettings.put(\"hibernate.session_factory.observer\", MyObserver.class.getName());","handlingStrategy":"validation","validationCode":"// only the 3 supported forms are allowed\nObject v = settings.get(SETTING_KEY);\nif (!(v instanceof String || v instanceof Class || expectedType.isInstance(v))) {\n    throw new IllegalArgumentException(SETTING_KEY + \" must be an instance, Class, or FQCN String, got: \" + (v == null ? \"null\" : v.getClass()));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on FQCN strings for XML/properties config and Class/instance objects for programmatic config.","Type any programmatic config maps so accidental boxing/enums cannot slip in."],"tags":["hibernate","jpa","configuration","invalid-value","bootstrap"],"backgroundTag":"invalid-configuration-value","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}