{"record":{"id":"65502307d44d34aa","repo":"hibernate/hibernate-orm","slug":"unable-to-instantiate-custom-auxiliarydatabaseobje","errorCode":null,"errorMessage":"Unable to instantiate custom AuxiliaryDatabaseObject class [%s]","messagePattern":"Unable to instantiate custom AuxiliaryDatabaseObject class \\[(.+?)\\]","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/AuxiliaryDatabaseObjectBinder.java","lineNumber":34,"sourceCode":"public class AuxiliaryDatabaseObjectBinder {\n\tpublic static void processAuxiliaryDatabaseObject(\n\t\t\tMetadataBuildingContext context,\n\t\t\tDatabaseObjectRegistration databaseObjectRegistration) {\n\t\tfinal AuxiliaryDatabaseObject auxDbObject;\n\n\t\tif ( StringHelper.isNotEmpty( databaseObjectRegistration.definition()) ) {\n\t\t\ttry {\n\t\t\t\tauxDbObject = (AuxiliaryDatabaseObject)\n\t\t\t\t\t\tcontext.getBootstrapContext().getClassLoaderService()\n\t\t\t\t\t\t\t\t.classForName( databaseObjectRegistration.definition() )\n\t\t\t\t\t\t\t\t.getConstructor()\n\t\t\t\t\t\t\t\t.newInstance();\n\t\t\t}\n\t\t\tcatch (ClassLoadingException cle) {\n\t\t\t\tthrow cle;\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tthrow new MappingException(\n\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\t\"Unable to instantiate custom AuxiliaryDatabaseObject class [%s]\",\n\t\t\t\t\t\t\t\tdatabaseObjectRegistration.definition()\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tauxDbObject = new SimpleAuxiliaryDatabaseObject(\n\t\t\t\t\tcontext.getMetadataCollector().getDatabase().getDefaultNamespace(),\n\t\t\t\t\tdatabaseObjectRegistration.create(),\n\t\t\t\t\tdatabaseObjectRegistration.drop(),\n\t\t\t\t\tnull\n\t\t\t);\n\t\t}\n\n\t\tif ( !databaseObjectRegistration.dialectScopes().isEmpty() ) {\n\t\t\tif ( auxDbObject instanceof AuxiliaryDatabaseObject.Expandable expandable ) {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AuxiliaryDatabaseObjectBinder.java#L16-L52","documentation":"Error \"Unable to instantiate custom AuxiliaryDatabaseObject class [%s]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Hibernate cannot instantiate a user-supplied class named in a mapping annotation.","commonSituations":"Custom AuxiliaryDatabaseObject or comparator classes that are missing from the classpath, non-public, abstract, or lack a usable no-arg constructor.","solutions":["Ensure the custom AuxiliaryDatabaseObject class has a public no-argument constructor.","Check that the class is on the classpath and that its name is spelled correctly in the mapping."],"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"}