{"record":{"id":"27668d7841032ed2","repo":"hibernate/hibernate-orm","slug":"typedefinition-to-register-cannot-define-null-typ","errorCode":null,"errorMessage":"TypeDefinition to register cannot define null #typeImplementorClass","messagePattern":"TypeDefinition to register cannot define null #typeImplementorClass","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/internal/TypeDefinitionRegistryStandardImpl.java","lineNumber":72,"sourceCode":"\t\t// Ultimately should maybe have TypeDefinition or the registry keep explicit\n\t\t// track of auto-applied definitions.\n\t\treturn basicJavaType.getJavaType() == null ? null\n\t\t\t\t: typeDefinitionMap.get( basicJavaType.getTypeName() );\n\t}\n\n\t@Override\n\tpublic TypeDefinitionRegistry register(TypeDefinition typeDefinition) {\n\t\treturn register( typeDefinition, DuplicationStrategy.OVERWRITE );\n\t}\n\n\t@Override\n\tpublic TypeDefinitionRegistry register(TypeDefinition typeDefinition, DuplicationStrategy duplicationStrategy) {\n\t\tif ( typeDefinition == null ) {\n\t\t\tthrow new IllegalArgumentException( \"TypeDefinition to register cannot be null\" );\n\t\t}\n\n\t\tif ( typeDefinition.getTypeImplementorClass() == null ) {\n\t\t\tthrow new IllegalArgumentException( \"TypeDefinition to register cannot define null #typeImplementorClass\" );\n\t\t}\n\n\t\tfinal String typeDefinitionName = typeDefinition.getName();\n\t\tif ( !isEmpty( typeDefinitionName ) ) {\n\t\t\tregister( typeDefinitionName, typeDefinition, duplicationStrategy );\n\t\t}\n\n\t\tfinal String[] registrationKeys = typeDefinition.getRegistrationKeys();\n\t\tif ( registrationKeys != null ) {\n\t\t\tfor ( String registrationKey : registrationKeys ) {\n\t\t\t\tregister( registrationKey, typeDefinition, duplicationStrategy );\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprivate void register(String name, TypeDefinition typeDefinition, DuplicationStrategy duplicationStrategy) {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/internal/TypeDefinitionRegistryStandardImpl.java#L54-L90","documentation":"Error \"TypeDefinition to register cannot define null #typeImplementorClass\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An invalid TypeDefinition is registered or overwritten in the type registry.","commonSituations":"Registering a null TypeDefinition, one without a type implementor class, or re-registering an existing name without overwrite permission.","solutions":["Provide a non-null typeImplementorClass on the TypeDefinition before registering it.","Check the TypeDefinition construction code; the implementor class argument may be passed as null.","Use the TypeDefinitionBuilder (or equivalent) with all mandatory attributes set."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}