报错信息

org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in com/itrs/mapper/OrderMapper.xml
### The error occurred while processing mapper_resultMap[orderMap]
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/itrs/mapper/OrderMapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'order'.  Cause: java.lang.ClassNotFoundException: Cannot find class: orderat org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)at com.itrs.test.MybatisTest.test1(MybatisTest.java:33)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.base/java.lang.reflect.Method.invoke(Method.java:566)at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)at org.junit.runners.ParentRunner.run(ParentRunner.java:363)at org.junit.runner.JUnitCore.run(JUnitCore.java:137)at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/itrs/mapper/OrderMapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'order'.  Cause: java.lang.ClassNotFoundException: Cannot find class: orderat org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:121)at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:98)at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78)... 24 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/itrs/mapper/OrderMapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'order'.  Cause: java.lang.ClassNotFoundException: Cannot find class: orderat org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:122)at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:94)at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:374)at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:119)... 26 more
Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'order'.  Cause: java.lang.ClassNotFoundException: Cannot find class: orderat org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:118)at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:262)at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:253)at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:245)at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:118)... 29 more
Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'order'.  Cause: java.lang.ClassNotFoundException: Cannot find class: orderat org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:120)at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:149)at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:116)... 33 more
Caused by: java.lang.ClassNotFoundException: Cannot find class: orderat org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:200)at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:89)at org.apache.ibatis.io.Resources.classForName(Resources.java:261)at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:116)... 35 more

问题描述:

这里显示了:分析SQL映射程序配置时出错,分析映射器XML时出错和类型TypeException:无法解析类型别名“order”。

原因分析:

无法解析类型别名“order”,查看

sqlMapConfig.xml,发现漏写自定义别名order

解决方案:

<!--自定义别名--><typeAliases><typeAlias type="com.itrs.domain.User" alias="user"></typeAlias><typeAlias type="com.itrs.domain.Order" alias="order"></typeAlias></typeAliases>

添加自定义别名即可,问题解决

Error building SqlSession. ### The error may exist in com/itrs/mapper/OrderMapper.xml ### The error相关推荐

  1. ### Error building SqlSession. ### The error may exist in com/itrs/mapper/UserMapper.xml ### Cause:

    项目场景: Mybatis 问题描述: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession ...

  2. ### Error building SqlSession.### The error may exist in entity/UserMapper.xml

    错误样式: 核心错误提示: ### Error building SqlSession. ### The error may exist in entity/UserMapper.xml 原因:就是M ...

  3. Error building SqlSession.The error may exist in cn/library/mapper/UserMapper.xml(Mybatis搭建测试中的错误解决)

    一.问题详情 IDEA2019中在搭建Mybatis简化DAO操作时报错: 错误分析:初步判断存在于配置文件UserMapper.xml中. 错误详情: org.apache.ibatis.excep ...

  4. org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may

    报错显示: org.apache.ibatis.exceptions.PersistenceException: Error building SqlSession. The error may ex ...

  5. ### Error building SqlSession. ### Cause: org.apache.ibatis.builder.BuilderException: Error creating

    mybatis报错: ###Error building SqlSession. ###Cause: org.apache.ibatis.builder.BuilderException: Error ...

  6. The error may exist in bshr/mapper/PfmMapper.xml ### The error may involve defaultParameterMap

    问题背景: springboot + mybatis + vue项目,IDEA开发. 绩效计划通过eid(员工编号)关联一个员工,有一个绩效计划表还有一个员工表. 关联方式为:嵌套查询.可以有两种实现 ...

  7. Error building SqlSession问题

    1.mybatis核心文件没有配置好 甚至是mapper的位置是否放置好也会导致 所以注意自己配置时候的核心文件是否正确 2.返回的结果类型没配置好 返回结果的权限在设置的时候应当选择该包所在的位置, ...

  8. The error may exist in XX/XXX/mapper/XXXMapper.xml的解决方法

    使用mybatis框架,在连接数据库进行添加用户时,出现了问题,如下:(关键部分已用红框标出) 于是我去XXMapper.xml文件中检查代码,发现是sql语句中"values(a,b,c) ...

  9. ### The error may exist in com/itheima/mapper/UserMapper.xml ### Cause: org.apache.ibatis.builder.Bu

    解决办法: 在sqlMapConfig.xml文件中,配置mapper,加载映射文件时,路径写的有问题,解决办法是找到UserMapper.xml文件,并且鼠标右键选择Copy Relative Pa ...

最新文章

  1. python cnn代码详解图解_TextCNN 代码详解(附测试数据集以及GitHub 地址)
  2. 迁移学习CNN图像分类模型 - 花朵图片分类
  3. 一个完整的Core Data应用
  4. Lambda表达式很鸡肋?它到底有何用呢?
  5. EventBridge消息路由|高效构建消息路由能力
  6. PAT甲级题目翻译+答案 AcWing(哈希表)
  7. JavaScript实现页面滚动到div区域div以动画方式出现
  8. 史上最简单的决策树模型讲解
  9. 腾讯云云机安装dockers
  10. 吊打奔驰宝马!这个又贵又丑的“玩具”,为何让男人集体高潮?
  11. Discuz论坛分表以及memcache缓存优化
  12. 大学生买macbookpro合适吗?
  13. Javascript特效:动态获取鼠标位置
  14. ScrollView不设置contentSize属性依然也可以作为底层滚动View(使用masonry设置scrollView的contentSize)...
  15. 基于stm32单片机外文文献_基于STM32的智能家居系统设计毕业论文+任务书+开题报告+文献综述+外文翻译及原文+程序+原理图+参考资料+答辩PPT+仿真设计...
  16. jq 获取引入页面url_jQuery获取当前页面的URL信息
  17. css在线代码生成工具汇总
  18. OOAD 3 迭代、进化和敏捷(Iterative,Evolutionary,and Agile)
  19. 惠普打印机驱动下载(电脑系统和打印机型号自动匹配)
  20. 使360浏览器打开网页默认为极速模式

热门文章

  1. 身份证,手机号码打码显示
  2. ceph提示: non-power-of-two pg_num解决办法
  3. 我的世界服务器显示outofmemory,我的世界out of memory怎么办 out of memory解决办法
  4. 是真佛只道家常,读《麦肯锡工具》——leo鉴书(15)
  5. Leetcode69-Sqrt(x)
  6. 华东师范大学周傲英教授谈创办数据本科专业的初衷
  7. 单相半桥逆变器仿真技巧
  8. Kalman 滤波用于自由落体运动目标跟踪问题
  9. 青龙面板搭建(狗东代挂)搭建详细保姆级教程
  10. 【阿朱说】到底啥叫企业数字化转型