org.apache.ibatis.builder.BuilderException: Error resolving JdbcType.从字面上面来理解这个异常,很明显是错误解析JdbcType,即在resultMap映射的时候,<result>或<id>元素的jdbcType属性填写不正确。请读者仔细检查你的Mapper配置文件中jdbcType是否书写有误。
java.lang.IllegalArgumentException: No enum const class org.apache.ibatis.type.JdbcType.INTGER
该提示更是明确表示MyBatis中没有INTGER的JdbcType,将INTGER改为INTEGER。即可!
错误详细信息:
log4j:WARN No appenders could be found for logger (org.apache.ibatis.logging.LogFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See https://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may exist in mybatis/config/StudentForConfigMapper.xml ### The error occurred while processing mapper_resultMap[userBeanMap] ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum const class org.apache.ibatis.type.JdbcType.INTGER at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:79) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:63) at mybatis.config.ClientForConfig.invoke(ClientForConfig.java:29) at mybatis.config.ClientForConfig.main(ClientForConfig.java:22) Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum const class org.apache.ibatis.type.JdbcType.INTGER at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:106) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:89) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:77) ... 3 more Caused by: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum const class org.apache.ibatis.type.JdbcType.INTGER at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:113) at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88) at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:316) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:104) ... 5 more Caused by: org.apache.ibatis.builder.BuilderException: Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: No enum const class org.apache.ibatis.type.JdbcType.INTGER at org.apache.ibatis.builder.BaseBuilder.resolveJdbcType(BaseBuilder.java:63) at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildResultMappingFromContext(XMLMapperBuilder.java:364) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:272) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:244) at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:236) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:109) ... 8 more Caused by: java.lang.IllegalArgumentException: No enum const class org.apache.ibatis.type.JdbcType.INTGER at java.lang.Enum.valueOf(Enum.java:196) at org.apache.ibatis.type.JdbcType.valueOf(JdbcType.java:22) at org.apache.ibatis.builder.BaseBuilder.resolveJdbcType(BaseBuilder.java:61) ... 13 more
点击学习 MyBatis 教程,了解更多的 MyBatis 知识!