{"record":{"id":"5b080ba8b3e8d32e","repo":"apereo/cas","slug":"dialect-name-must-be-a-fully-qualified-class-name","errorCode":null,"errorMessage":"Dialect name must be a fully qualified class name. Supported dialects by default are [{}] or you may specify the dialect class directly","messagePattern":"Dialect name must be a fully qualified class name\\. Supported dialects by default are \\[(.+?)\\] or you may specify the dialect class directly","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/db/GenerateDdlCommand.java","lineNumber":134,"sourceCode":"            longName = \"createSchema\",\n            description = \"Generate DROP SQL statements in the DDL\",\n            defaultValue = \"false\"\n        )\n        final Boolean createSchema,\n\n        @Option(\n            longName = \"haltOnError\",\n            description = \"Halt if an error occurs during the generation process\",\n            defaultValue = \"false\"\n        )\n        final Boolean haltOnError\n    ) {\n\n        LOGGER.info(\"Requested database dialect type [{}]\", dialect);\n        val dialectName = DIALECTS_MAP.getOrDefault(dialect.trim(), dialect);\n        LOGGER.info(\"Using database dialect class [{}]\", dialectName);\n        if (!dialectName.contains(\".\")) {\n            LOGGER.warn(\"Dialect name must be a fully qualified class name. Supported dialects by default are [{}] \"\n                + \"or you may specify the dialect class directly\", DIALECTS_MAP.keySet());\n            return null;\n        }\n\n        val svcRegistry = new StandardServiceRegistryBuilder();\n\n        val settings = new HashMap<String, Object>();\n        settings.put(JdbcSettings.DIALECT, dialectName);\n        settings.put(JdbcSettings.JAKARTA_JDBC_URL, jdbcUrl);\n        settings.put(SchemaToolingSettings.HBM2DDL_AUTO, \"none\");\n        settings.put(JdbcSettings.SHOW_SQL, \"true\");\n        svcRegistry.applySettings(settings);\n\n        LOGGER.info(\"Collecting entity metadata sources...\");\n        val metadata = new MetadataSources(svcRegistry.build());\n        ReflectionUtils.findClassesWithAnnotationsInPackage(\n                Set.of(MappedSuperclass.class, Entity.class),\n                \"org.apereo.cas\")","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/db/GenerateDdlCommand.java#L116-L152","documentation":"GenerateDdlCommand (CAS shell) maps short dialect names (e.g. H2, MYSQL) to Hibernate dialect class names via DIALECTS_MAP; any value not in the map is treated as a class name. If the resolved dialect name contains no dot, it cannot be a fully qualified class name, so the command warns and returns null without generating DDL.","triggerScenarios":"Running generate-ddl with --dialect set to an unrecognized short name (not in DIALECTS_MAP) that is also not a fully qualified Hibernate dialect class, e.g. a typo like 'POSTGRES' or 'MSSQL' when only certain keys exist.","commonSituations":"Guessing the dialect keyword instead of checking the supported set; using a Hibernate 6 dialect class name against a different Hibernate version; passing a database product name like 'postgresql'.","solutions":["Use one of the supported short dialect keys printed in the warning (DIALECTS_MAP keySet).","Pass the fully qualified Hibernate dialect class instead, e.g. org.hibernate.dialect.PostgreSQLDialect.","Check the exact spelling/casing of the dialect key; the lookup is exact after trim()."],"exampleFix":"// before\ngenerate-ddl --dialect POSTGRES\n// after\ngenerate-ddl --dialect org.hibernate.dialect.PostgreSQLDialect","handlingStrategy":"validation","validationCode":"String dialectName = DIALECTS_MAP.getOrDefault(dialect.trim(), dialect);\nif (!dialectName.contains(\".\")) {\n    throw new IllegalArgumentException(\"Use a supported key or FQCN: \" + DIALECTS_MAP.keySet());\n}\nClass.forName(dialectName); // verify the dialect class exists before running","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Consult the printed DIALECTS_MAP.keySet() before choosing a short name.","Use fully qualified Hibernate dialect class names when unsure.","Match the dialect class to your Hibernate version."],"tags":["hibernate","ddl","cli","dialect"],"backgroundTag":"invalid-cli-argument","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}