{"record":{"id":"6b2065959f84739d","repo":"mybatis/mybatis-3","slug":"error-registering-typealias-for-alias-cause","errorCode":null,"errorMessage":"Error registering typeAlias for '{alias}'. Cause: {cause}","messagePattern":"Error registering typeAlias for '(.+?)'\\. Cause: (.+?)","errorType":"exception","errorClass":"BuilderException","httpStatus":null,"severity":"error","filePath":"src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java","lineNumber":192,"sourceCode":"    if (context == null) {\n      return;\n    }\n    for (XNode child : context.getChildren()) {\n      if (\"package\".equals(child.getName())) {\n        String typeAliasPackage = child.getStringAttribute(\"name\");\n        configuration.getTypeAliasRegistry().registerAliases(typeAliasPackage);\n      } else {\n        String alias = child.getStringAttribute(\"alias\");\n        String type = child.getStringAttribute(\"type\");\n        try {\n          Class<?> clazz = Resources.classForName(type);\n          if (alias == null) {\n            typeAliasRegistry.registerAlias(clazz);\n          } else {\n            typeAliasRegistry.registerAlias(alias, clazz);\n          }\n        } catch (ClassNotFoundException e) {\n          throw new BuilderException(\"Error registering typeAlias for '\" + alias + \"'. Cause: \" + e, e);\n        }\n      }\n    }\n  }\n\n  private void pluginsElement(XNode context) throws Exception {\n    if (context != null) {\n      for (XNode child : context.getChildren()) {\n        String interceptor = child.getStringAttribute(\"interceptor\");\n        Properties properties = child.getChildrenAsProperties();\n        Interceptor interceptorInstance = (Interceptor) resolveClass(interceptor).getDeclaredConstructor()\n            .newInstance();\n        interceptorInstance.setProperties(properties);\n        configuration.addInterceptor(interceptorInstance);\n      }\n    }\n  }\n","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/mybatis/mybatis-3/blob/008069adb1b089579b5dcba87ee591908b263274/src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java#L174-L210","documentation":"Error \"Error registering typeAlias for '{alias}'. Cause: {cause}\" thrown in mybatis/mybatis-3.","triggerScenarios":"Thrown at src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the nested cause; usually the aliased class cannot be loaded or the alias conflicts with an existing one.","Verify the class named in the typeAlias element exists on the classpath and is spelled correctly.","Choose a different alias if it collides with a built-in or previously registered alias."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"008069adb1b089579b5dcba87ee591908b263274","analyzedAt":"2026-08-14T13:07:10.264Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}