{"record":{"id":"2e64e14824899f43","repo":"quarkusio/quarkus","slug":"the-provided-settingname-setting-value-setting","errorCode":null,"errorMessage":"The provided <settingName> setting value [<settingValue>] is not supported!","messagePattern":"The provided <settingName> setting value \\[<settingValue>\\] is not supported!","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/FastBootMetadataBuilder.java","lineNumber":697,"sourceCode":"        if (clazz.isAssignableFrom(settingValue.getClass())) {\n            instance = (T) settingValue;\n        } else if (settingValue instanceof Class) {\n            instanceClass = (Class<? extends T>) settingValue;\n        } else if (settingValue instanceof String) {\n            String settingStringValue = (String) settingValue;\n            if (standardServiceRegistry != null) {\n                final ClassLoaderService classLoaderService = standardServiceRegistry.getService(ClassLoaderService.class);\n\n                instanceClass = classLoaderService.classForName(settingStringValue);\n            } else {\n                try {\n                    instanceClass = (Class<? extends T>) Class.forName(settingStringValue);\n                } catch (ClassNotFoundException e) {\n                    throw new IllegalArgumentException(\"Can't load class: \" + settingStringValue, e);\n                }\n            }\n        } else {\n            throw new IllegalArgumentException(\n                    \"The provided \" + settingName + \" setting value [\" + settingValue + \"] is not supported!\");\n        }\n\n        if (instanceClass != null) {\n            try {\n                instance = instanceClass.getConstructor().newInstance();\n            } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {\n                throw new IllegalArgumentException(\n                        \"The \" + clazz.getSimpleName() + \" class [\" + instanceClass + \"] could not be instantiated!\",\n                        e);\n            }\n        }\n\n        return instance;\n    }\n\n}\n","sourceCodeStart":679,"sourceCodeEnd":715,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/FastBootMetadataBuilder.java#L679-L715","documentation":"loadSettingInstance expects the setting value to be either a Class object or a String containing a class name. If the configured value is neither (e.g. an instance of some other type, or a bare name that is not meant to be a class), the builder rejects it with this IllegalArgumentException naming the setting and the offending value.","triggerScenarios":"Passing a non-Class/non-String object into a setting like hibernate.metadata_builder_contributor (or its Quarkus equivalents) — e.g. programmatically setting an instance, a lambda, or a wrong type via a custom properties map fed to FastBootMetadataBuilder.","commonSituations":"Building the persistence unit properties programmatically and putting an instance object instead of the class; config binding mapping the property to a non-String type; copying plain-Hibernate settings that accept instances into the Quarkus static-init bootstrap which only accepts class names.","solutions":["Supply the value as a String containing the fully-qualified class name (or the Class itself), not an instance.","Inspect the message's settingName/value to find which property holds the wrong type.","Remove the property if an equivalent Quarkus-first configuration option exists (e.g. quarkus.hibernate.orm.metadata-builder-contributor)."],"exampleFix":"// before\nproperties.put(AvailableSettings.SESSION_FACTORY_NAME, myNamingStrategyInstance); // wrong slot/type\n// after\nproperties.put(AvailableSettings.PHYSICAL_NAMING_STRATEGY, \"com.example.MyPhysicalNamingStrategy\");","handlingStrategy":"validation","validationCode":"Object v = properties.get(settingName);\nif (v != null && !(v instanceof String) && !(v instanceof Class)) {\n    throw new IllegalArgumentException(settingName + \" must be a class name String or Class, got \" + v.getClass());\n}","typeGuard":null,"tryCatchPattern":"try {\n    bootPersistenceUnit();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"is not supported\")) {\n        log.error(\"Setting value has wrong type; provide a class name string\");\n    }\n}","preventionTips":["Always configure class-valued settings as fully-qualified class name strings","Do not put instances into Hibernate settings maps when booting via Quarkus","Prefer Quarkus-native typed configuration properties over raw Hibernate settings"],"tags":["hibernate-orm","configuration","type-mismatch","settings"],"backgroundTag":"invalid-setting-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}