页面发生500错误
org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/imooc/sm/dao/DepartmentDao.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ' String'. Cause: java.lang.ClassNotFoundException: Cannot find class: String
网页错误是
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentController': Unsatisfied dependency expressed through field 'departmentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentService': Unsatisfied dependency expressed through field 'departmentDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'departmentDao' defined in URL [jar:file:/D:/apache-tomcat-8.5.39/webapps/ROOT/WEB-INF/lib/sm_service-1.0-SNAPSHOT.jar!/com/imooc/sm/dao/DepartmentDao.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/imooc/sm/dao/DepartmentDao.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ' String'. Cause: java.lang.ClassNotFoundException: Cannot find class: String
正在回答
同学,你好!检查一下DepartmentDao.xml文件,看一下resultType或者resultMap的内容是否写错了,可以和老师的源码对比一下。如果还不能解决,建议将DepartmentDao.xml的内容贴出来,贴到我要回答里。图片也可以放到我要回答里。
如下所示:鼠标单击我要回答的文本框,就会看到第二张图中的内容,点击选中的图标就可以上传图片了。


如果我的回答解决了你的疑惑,请采纳!祝学习愉快!
相似问题
登录后可查看更多问答,登录/注册
- 参与学习 人
- 提交作业 323 份
- 解答问题 8263 个
本阶段将带你学习主流框架SSM,以及SpringBoot ,打通成为Java工程师的最后一公里!
了解课程


恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星