{"record":{"id":"a3e994e3e6d51b7e","repo":"hibernate/hibernate-orm","slug":"unrecognized-hibernate-hbm2ddl-auto-setting-s","errorCode":null,"errorMessage":"Unrecognized 'hibernate.hbm2ddl.auto' setting: '%s'","messagePattern":"Unrecognized 'hibernate\\.hbm2ddl\\.auto' setting: '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/tool/schema/Action.java","lineNumber":338,"sourceCode":"\t\t}\n\n\t\t// prefer hbm2ddl names\n\t\tfor ( var action : values() ) {\n\t\t\tfinal String hbm2ddlName = action.getExternalHbm2ddlName();\n\t\t\tif ( hbm2ddlName != null && hbm2ddlName.equals( name ) ) {\n\t\t\t\treturn action;\n\t\t\t}\n\t\t}\n\n\t\t// then check JPA external names\n\t\tfor ( var action : values() ) {\n\t\t\tfinal String jpaName = action.getExternalJpaName();\n\t\t\tif ( jpaName != null && jpaName.equals( name ) ) {\n\t\t\t\treturn action;\n\t\t\t}\n\t\t}\n\n\t\tthrow new IllegalArgumentException( \"Unrecognized '\" + HBM2DDL_AUTO + \"' setting: '\" + name + \"'\" );\n\t}\n\n}\n","sourceCodeStart":320,"sourceCodeEnd":342,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/tool/schema/Action.java#L320-L342","documentation":"hibernate.hbm2ddl.auto is interpreted by matching legacy hbm2ddl names, then JPA external names, then enum constant names. A trimmed value that matches none of them throws this IllegalArgumentException, listing the exact offending string so the bad token is easy to spot in config.","triggerScenarios":"Setting hibernate.hbm2ddl.auto to anything outside none, validate, update, create, create-drop, create-only, drop, drop-only (plus accepted JPA names): typos like \"validate-schema\", \"update-only\", \"creat\", or \"drop_and_create\" in wrong casing/form.","commonSituations":"A typo in spring.jpa.hibernate.ddl-auto forwarded into Hibernate; profile-specific overrides with wrong tokens; ops runbooks or env vars (HBM2DDL_AUTO) supplying bad values; docs or templates suggesting nonexistent values like \"none-create\".","solutions":["Correct the value to a supported one: none, validate, update, create, create-drop, create-only, drop, drop-only (JPA drop-and-create is also accepted).","Trace where the value comes from — spring.jpa.hibernate.ddl-auto, environment variables, bootstrap properties — and fix it at that source."],"exampleFix":"# before\nspring.jpa.hibernate.ddl-auto: validate-schema\n\n# after\nspring.jpa.hibernate.ddl-auto: validate","handlingStrategy":"validation","validationCode":"private static final Set<String> VALID_HBM2DDL = Set.of(\n        \"none\", \"validate\", \"update\", \"create\", \"create-drop\",\n        \"create-only\", \"drop\", \"drop-only\", \"drop-and-create\");\n\nString token = ddlAuto == null ? null : ddlAuto.trim().toLowerCase(Locale.ROOT);\nif (token != null && !VALID_HBM2DDL.contains(token)) {\n    throw new IllegalStateException(\"Bad hibernate.hbm2ddl.auto value: \" + ddlAuto);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate ddl-auto tokens at app startup, including values forwarded by Spring.","Lint environment variables that feed hbm2ddl in deployment pipelines.","Use one canonical casing convention for enum-like properties."],"tags":["hibernate","hbm2ddl","schema-generation","configuration","spring"],"backgroundTag":"invalid-schema-management-action","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}